[Numpy-discussion] numarray cov function

Travis Oliphant oliphant.travis at ieee.org
Sun Aug 13 17:33:28 EDT 2006


John Hunter wrote:
> I was surprised to see that numarray.mlab.cov is returning a rank-0
> complex number when given two 1D arrays as inputs rather than the
> standard 2x2 covariance array I am used to seeing.  Is this a feature
> or a bug?  
>
>
> In [2]: import numarray.mlab as nam
>
> In [3]: x = nam.rand(10)
>
> In [4]: y = nam.rand(10)  
>
> In [5]: nam.cov(x, y)
> Out[5]: array((0.014697855954587828+0j))
>
> In [6]: import numpy.oldnumeric.mlab as npm
>
> In [7]: x = npm.rand(10)
>
> In [8]: y = npm.rand(10)
>
> In [9]: npm.cov(x, y)
> Out[9]: 
> array([[ 0.13243082,  0.0520454 ],
>        [ 0.0520454 ,  0.07435816]])
>
> In [10]: import numarray
>
> In [11]: numarray.__version__
> Out[11]: '1.3.3'
>
> In [12]: import numpy
>
> In [13]: numpy.__version__
> Out[13]: '1.0b2.dev2999'
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/numpy-discussion
>   





More information about the NumPy-Discussion mailing list