title: How can I create a matrix, or convert a 2D array into matrix in Python?
body: <p>I wish to be able to extract a row or a column from a 2D array in Python such that it preserves the 2D shape and can be used for matrix multiplication. However, I cannot find in the <a href="http://docs.scipy.org/doc/numpy/reference/routines.array-creation.html" rel="nofollow">documentation</a> how can this best be done. For example, I can use</p>
  
  <pre><code>a = np.zeros(shape=(6,6)) 
  </code></pre>
  
  <p>to create an array, but a[:,0] will have the shape of (6,), and I cannot multiply this by a matrix of shape (6,1). Do I need to reshape a row or a column of an array into a matrix for every matrix multiplication, or are there other ways to do matrix multiplication? </p>