title: NumPy: how to quickly normalize many vectors?
body: <p>How can a list of vectors be elegantly normalized, in NumPy?</p>
  
  <p>Here is an example that does <em>not</em> work:</p>
  
  <pre><code>from numpy import *
  
  vectors = array([arange(10), arange(10)])  # All x's, then all y's
  norms = apply_along_axis(linalg.norm, 0, vectors)
  
  # Now, what I was expecting would work:
  print vectors.T / norms  # vectors.T has 10 elements, as does norms, but this does not work
  </code></pre>
  
  <p>The last operation yields "shape mismatch: objects cannot be broadcast to a single shape".</p>
  
  <p>How can the normalization of the 2D vectors in <code>vectors</code> be elegantly done, with NumPy?</p>
  
  <p><strong>Edit</strong>: Why does the above not work while adding a dimension to <code>norms</code> does work (as per my answer below)?</p>