[SciPy-dev] stats.cov versus np.cov

josef.pktd@gmai... josef.pktd@gmai...
Mon Nov 24 11:12:43 CST 2008


in http://scipy.org/scipy/scipy/ticket/425, stats mean, var and median
got depreciated.

Should this also be done for cov?

Note: scipy and stats versions have different defaults for column
versus row variables

>>> x = np.array([[0, 2], [1, 1], [2, 0]]).T
>>> np.cov(x)
array([[ 1., -1.],
       [-1.,  1.]])
>>> stats.cov(x)
array([[ 2.,  0., -2.],
       [ 0.,  0.,  0.],
       [-2.,  0.,  2.]])
>>> stats.cov(x.T)
array([[ 1., -1.],
       [-1.,  1.]])
>>> np.mean(x)
1.0

Josef


More information about the Scipy-dev mailing list