title: numpy: Broadcasting a vector horizontally
body: <p>I have a 1-D array in numpy <code>v</code>.  I'd like to copy it to make a matrix with each row being a copy of <code>v</code>.  That's easy: <code>np.broadcast_to(v, desired_shape)</code>.</p>
  
  <p>However, if I'd like to treat <code>v</code> as a <em>column</em> vector, and copy it to make a matrix with each <strong>column</strong> being a copy of <code>v</code>, I can't find a simple way to do it.  Through trial and error, I'm able to do this:</p>
  
  <pre><code> np.broadcast_to(v.reshape(v.shape[0], 1), desired_shape)
  </code></pre>
  
  <p>While that works, I can't claim to understand it (even though I wrote it!).  </p>
  
  <p>Part of the problem is that numpy doesn't seem to have a concept of a column vector (hence the <code>reshape</code> hack instead of what in math would just be <code>.T</code>).</p>
  
  <p>But, a deeper part of the problem seems to be that broadcasting only works vertically, not horizontally.  Or perhaps a more correct way to say it would be: broadcasting only works on the higher dimensions, not the lower dimensions.  <em>I'm not even sure if that's correct.</em></p>
  
  <p>In short, while I understand the concept of broadcasting in general, when I try to use it for particular applications, like copying the col vector to make a matrix, I get lost.</p>
  
  <p><strong>Can you help me understand</strong> or improve the readability <strong>of this code</strong>?</p>