title: compute distance matrix from list of vectors
body: <p>Say I have a list of vectors and I want to generate a distance matrix from it. What is a neat way to do it? Eg, I have a list of 3 vectors:</p>
  
  <pre><code>k = [[2, 4, 7], [3, 4, 7], [5,1,3]]
  distance = pairwise_distances(v1, v2, metric='cosine', n_jobs=-1)
  </code></pre>
  
  <p>Desired output: A numpy array of cosine-distances of the given vector list.</p>
  
  <pre><code>array([[ 1.        ,  0.00638545,  0.28778769],
         [ 0.00638545,  1.        ,  0.21402251],
         [ 0.28778769,  0.21402251,  1.        ]])
  </code></pre>
  
  <p>This is what I have done: Got all the combinations using itertools.combinations. Computed the distances for each pair. Then, it becomes a little messy to actually place the distance measures at the "right" cell (need indices of the original vectors in the list). </p>
  
  <pre><code>combs = list(itertools.combinations(k, 2))
  print combs
  </code></pre>
  
  <p>Is there a "neater" or "pythonic" way of getting at the final distance matrix?</p>