Difference between single and double bracket Numpy array?
<p>What is the difference between these two numpy objects?</p>

<pre><code>import numpy as np
np.array([[0,0,0,0]])
np.array([0,0,0,0])
</code></pre>

<pre><code>In [71]: np.array([[0,0,0,0]]).shape
Out[71]: (1, 4)

In [72]: np.array([0,0,0,0]).shape
Out[72]: (4,)
</code></pre>

<p>The former is a 1 x 4 two-dimensional array, the latter a 4 element one dimensional array.</p>

python numpy