title: How to assign a 1D numpy array to 2D numpy array?
body: <p>Consider the following simple example:</p>
  
  <pre><code>X = numpy.zeros([10, 4])  # 2D array
  x = numpy.arange(0,10)    # 1D array 
  
  X[:,0] = x # WORKS
  
  X[:,0:1] = x # returns ERROR: 
  # ValueError: could not broadcast input array from shape (10) into shape (10,1)
  
  X[:,0:1] = (x.reshape(-1, 1)) # WORKS
  </code></pre>
  
  <p>Can someone explain why numpy has vectors of shape (N,) rather than (N,1) ? 
  What is the best way to do the casting from 1D array into 2D array?</p>
  
  <p>Why do I need this? 
  Because I have a code which inserts result <code>x</code> into a 2D array <code>X</code> and the size of x changes from time to time so I have <code>X[:, idx1:idx2] = x</code> which works if <code>x</code> is 2D too but not if x is 1D.</p>