[Numpy-discussion] corrcoef

John Hunter jdh2358@gmail....
Thu Sep 6 13:06:50 CDT 2007


Is it desirable that numpy.corrcoef for two arrays returns a 2x2 array
rather than a scalar

In [10]: npy.corrcoef(npy.random.rand(10), npy.random.rand(10))
Out[10]:
array([[ 1.        , -0.16088728],
       [-0.16088728,  1.        ]])


I always end up extracting the 0,1 element anyway.  What is the
advantage, aside from backwards compatibility, for returning a 2x2?
JDH


More information about the Numpy-discussion mailing list