title: How do you get the magnitude of a vector in Numpy?
body: <p>In keeping with the "There's only one obvious way to do it", how do you get the magnitude of a vector (1D array) in Numpy?</p>
  
  <pre><code>def mag(x): 
      return math.sqrt(sum(i**2 for i in x))
  </code></pre>
  
  <p>The above works, but I <em>cannot believe</em> that I must specify such a trivial and core function myself.</p>