title: Numpy: 1D array with various shape
body: <p>I try to understand how to handle a <code>1D</code> array (vector in linear algebra) with <code>NumPy</code>.</p>
  <p>In the following example, I generate two <code>numpy.array</code> <code>a</code> and <code>b</code>:</p>
  <pre><code>&gt;&gt;&gt; import numpy as np
  &gt;&gt;&gt; a = np.array([1,2,3])
  &gt;&gt;&gt; b = np.array([[1],[2],[3]]).reshape(1,3)
  &gt;&gt;&gt; a.shape
  (3,)
  &gt;&gt;&gt; b.shape
  (1, 3)
  </code></pre>
  <p>For me, <code>a</code> and <code>b</code> have the same shape according linear algebra definition: 1 row, 3 columns, but not for <code>NumPy</code>.</p>
  <p>Now, the <code>NumPy</code> <code>dot</code> product:</p>
  <pre><code>&gt;&gt;&gt; np.dot(a,a)
  14
  &gt;&gt;&gt; np.dot(b,a)
  array([14])
  &gt;&gt;&gt; np.dot(b,b)
  Traceback (most recent call last):
    File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;
  ValueError: objects are not aligned
  </code></pre>
  <p>I have three different outputs.</p>
  <p><strong>What's the difference between <code>dot(a,a)</code> and <code>dot(b,a)</code>? Why dot<code>(b,b)</code> doesn't work?</strong></p>
  <p>I also have some differencies with those dot products:</p>
  <pre><code>&gt;&gt;&gt; c = np.ones(9).reshape(3,3)
  &gt;&gt;&gt; np.dot(a,c)
  array([ 6.,  6.,  6.])
  &gt;&gt;&gt; np.dot(b,c)
  array([[ 6.,  6.,  6.]])
  </code></pre>