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
John Hunter schrieb:
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
On Friday 25 May 2007 19:18, Robert Kern wrote:
Jesper Larsen wrote:
Hi numpy users,
I have a masked array of dimension (nvariables, nobservations) that
contain missing values at arbitrary points. Is it safe to rely on
numpy.corrcoeff to calculate the correlation coefficients of a
Jesper Larsen wrote:
Here is my solution for calculating the correlation coefficients for masked
arrays. Comments are appreciated:
def macorrcoef(data1, data2):
Calculates correlation coefficients taking masked out values
into account.
It is assumed (but not checked) that