Numpy array of numpy arrays has 1D shape
<p>I have two numpy arrays of arrays (A and B). They look something like this when printed: </p>

<p>A: </p>

<pre><code>[array([0, 0, 0]) array([0, 0, 0]) array([1, 0, 0]) array([0, 0, 0])
 array([0, 0, 0]) array([0, 0, 0]) array([0, 0, 0]) array([0, 0, 0])
 array([0, 0, 0]) array([0, 0, 0]) array([0, 0, 1]) array([0, 0, 0])
 array([1, 0, 0]) array([0, 0, 1]) array([0, 0, 0]) array([0, 0, 0])
 array([0, 0, 0]) array([1, 0, 0]) array([0, 0, 1]) array([0, 0, 0])]
</code></pre>

<p>B: </p>

<pre><code>[[  4.302135e-01   4.320091e-01   4.302135e-01   4.302135e-01
    1.172584e+08]
 [  4.097128e-01   4.097128e-01   4.077675e-01   4.077675e-01
    4.397120e+07]
 [  3.796353e-01   3.796353e-01   3.778396e-01   3.778396e-01
    2.643200e+07]
 [  3.871173e-01   3.890626e-01   3.871173e-01   3.871173e-01
    2.161040e+07]
 [  3.984899e-01   4.002856e-01   3.984899e-01   3.984899e-01
    1.836240e+07]
 [  4.227315e-01   4.246768e-01   4.227315e-01   4.227315e-01
    1.215760e+07]
 [  4.433817e-01   4.451774e-01   4.433817e-01   4.433817e-01
    9.340800e+06]
 [  4.620867e-01   4.638823e-01   4.620867e-01   4.620867e-01
    1.173760e+07]]
</code></pre>

<p><code>type(A)</code>, <code>type(A[0])</code>, <code>type(B)</code>, <code>type(B[0])</code> are all <code>&lt;class 'numpy.ndarray'&gt;</code>.</p>

<p>However, <code>A.shape</code> is <code>(20,)</code>, while <code>B.shape</code> is <code>(8, 5)</code>.</p>

<p>Question 1: Why is <code>A.shape</code> one-dimensional, and how do I make it two-dimensional like <code>B.shape</code>? They're both arrays of arrays, right?</p>

<p>Question 2, possibly related to Q1: Why does printing <code>A</code> show the calls of <code>array()</code>, while printing <code>B</code> doesn't, and why do the elements of the subarrays of <code>B</code> not have commas in-between them?</p>

<p>Thanks in advance.</p>