title: How to calculate euclidean distance between pair of rows of a numpy array
body: <p>I have a <code>numpy</code> array like:</p>
  
  <pre><code>import numpy as np
  a = np.array([[1,0,1,0],
               [1,1,0,0],
               [1,0,1,0],
               [0,0,1,1]])
  </code></pre>
  
  <p>I would like to calculate <code>euclidian distance</code> between each pair of rows. </p>
  
  <pre><code>from scipy.spatial import distance
  for i in range(0,a.shape[0]):
      d = [np.sqrt(np.sum((a[i]-a[j])**2)) for j in range(i+1,a.shape[0])]
      print(d)
  </code></pre>
  
  <blockquote>
    <p>[1.4142135623730951, 0.0, 1.4142135623730951]</p>
    
    <p>[1.4142135623730951, 2.0]</p>
    
    <p>[1.4142135623730951]</p>
    
    <p>[]</p>
  </blockquote>
  
  <p>Is there any better pythonic way to do this since i have to run this code on a huge <code>numpy</code> array?</p>