title: Transpose a 1-dimensional array in Numpy without casting to matrix
body: <p>My goal is to to turn a row vector into a column vector and vice versa. The documentation for <a href="https://docs.scipy.org/doc/numpy-1.15.1/reference/generated/numpy.ndarray.transpose.html" rel="noreferrer"><code>numpy.ndarray.transpose</code></a> says:</p>
  
  <blockquote>
    <p>For a 1-D array, this has no effect. (To change between column and row vectors, first cast the 1-D array into a matrix object.) </p>
  </blockquote>
  
  <p>However, when I try this:</p>
  
  <pre><code>my_array = np.array([1,2,3])
  my_array_T = np.transpose(np.matrix(myArray))
  </code></pre>
  
  <p>I do get the wanted result, albeit in matrix form (<code>matrix([[66],[640],[44]])</code>), but I also get this warning:</p>
  
  <blockquote>
    <p><strong>PendingDeprecationWarning</strong>: the matrix subclass is not the recommended way to represent matrices or deal with linear algebra (see <a href="https://docs.scipy.org/doc/numpy/user/numpy-for-matlab-users.html" rel="noreferrer">https://docs.scipy.org/doc/numpy/user/numpy-for-matlab-users.html</a>). Please adjust your code to use regular ndarray.  </p>
  
  <pre><code>my_array_T = np.transpose(np.matrix(my_array))
  </code></pre>
  </blockquote>
  
  <p>How can I properly transpose an <code>ndarray</code> then?</p>