title: From ND to 1D arrays
body: <p>Say I have an array <code>a</code>:</p>
  
  <pre><code>a = np.array([[1,2,3], [4,5,6]])
  
  array([[1, 2, 3],
         [4, 5, 6]])
  </code></pre>
  
  <p>I would like to convert it to a 1D array (i.e. a column vector):</p>
  
  <pre><code>b = np.reshape(a, (1,np.product(a.shape)))
  </code></pre>
  
  <p>but this returns</p>
  
  <pre><code>array([[1, 2, 3, 4, 5, 6]])
  </code></pre>
  
  <p>which is not the same as:</p>
  
  <pre><code>array([1, 2, 3, 4, 5, 6])
  </code></pre>
  
  <p>I can take the first element of this array to manually convert it to a 1D array:</p>
  
  <pre><code>b = np.reshape(a, (1,np.product(a.shape)))[0]
  </code></pre>
  
  <p>but this requires me to know how many dimensions the original array has (and concatenate [0]'s when working with higher dimensions)</p>
  
  <p>Is there a dimensions-independent way of getting a column/row vector from an arbitrary ndarray?</p>