title: Faster way of calculating a distance matrix with numpy?
body: <p>I am calculating a matrix with numpy/scipy like this:</p>
  
  <pre><code>cost = np.empty([chroma1.data.shape[1], chroma2.data.shape[1]])
  
  for x, cx in enumerate(chroma1.transpose()):
      for y, cy in enumerate(chroma2.transpose()):
          cost[x, y] = sp.distance.euclidean(cx, cy)
  </code></pre>
  
  <p>This takes quite an amount of time. Is there any numpy/scipy function that would allow me to get rid of the two nested loops?</p>