title: create a matrix out of a dictionary in python with labeled columns and rows
body: <p>currently i have a dictionary that looks something like this:</p>
  
  <pre><code>{'a':[1,2,3,0,0],'b':[1,5,2,1,4], 'c':[1,2,4,12,1]}
  </code></pre>
  
  <p>I'm trying to create a covariance matrix out of this dictionary. i already have a defined covariance function so ideally the output would look something like this (along with the keys as the labels for the rows and columns):</p>
  
  <pre><code>   a   b   c
  a   
  b
  c
  </code></pre>
  
  <p>The ith row jth column output would call the covariance function and have as its input the value (a vector) of key i and the value (a vector) of key j. For example:</p>
  
  <pre><code>covariance([1,5,2,1,4],[1,2,4,12,1])
  </code></pre>
  
  <p>I'm doing something like this right now to print out all the covariances but I'd prefer it in a matrix form:</p>
  
  <pre><code>keys=dictionary.keys()
  values=dictionary.values()
  for counter in range(len(values)-1):
      print keys[counter]-1 + '&amp;' + keys[counter] + ':' + covariance(values[counter-1],values[counter])
      counter+=1
  </code></pre>
  
  <p>which gives me: </p>
  
  <pre><code>a &amp; b: 0.10
  b &amp; c: 0.20
  </code></pre>
  
  <p>but no association with a &amp; c</p>
  
  <p>any help would be greatly appreciated. thanks.</p>