title: Correlate one set of vectors to another in numpy?
body: <p>Let's say I have a set of vectors (readings from sensor 1, readings from sensor 2, readings from sensor 3 -- indexed first by timestamp and then by sensor id) that I'd like to correlate to a separate set of vectors (temperature, humidity, etc -- also all indexed first by timestamp and secondly by type).</p>
  
  <p>What is the cleanest way in numpy to do this? It seems like it should be a rather simple function...</p>
  
  <p>In other words, I'd like to see:</p>
  
  <pre><code>&gt; a.shape 
  (365,20)
  
  &gt; b.shape
  (365, 5)
  
  &gt; correlations = magic_correlation_function(a,b)
  
  &gt; correlations.shape
  (20, 5)
  </code></pre>
  
  <p>Cheers,
  /YGA</p>
  
  <p>P.S. I've been asked to add an example.  </p>
  
  <p>Here's what I would like to see:</p>
  
  <pre><code>$ In [27]:  x
  $ Out[27]: 
  array([[ 0,  0,  0],
         [-1,  0, -1],
         [-2,  0, -2],
         [-3,  0, -3],
         [-4,  0.1, -4]])
  
  $ In [28]: y
  $ Out[28]: 
  array([[0, 0],
         [1, 0],
         [2, 0],
         [3, 0],
         [4, 0.1]])
  
  $ In [28]: magical_correlation_function(x, y)
  $ Out[28]: 
  array([[-1.        ,  0.70710678,  1.        ]
         [-0.70710678,  1.        ,  0.70710678]])
  </code></pre>
  
  <p>Ps2: whoops, mis-transcribed my example.  Sorry all.  Fixed now.</p>