Hello,

numpy.var exhibits a rather dangereous behviour, as I have just
noticed. In some cases, numpy.var calculates the variance, and in some
cases the standard deviation (=square root of variance). Is this
intended? I have to admit that I use numpy 0.9.6 at the moment. Has
this been changed in more recent versions?

Below a sample session


Python 2.4.3 (#1, May  8 2006, 18:35:42)
[GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-52)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> a = [1,2,3,4,5]
>>> numpy.var(a)
2.5
>>> numpy.std(a)
1.5811388300841898
>>> numpy.sqrt(2.5)
1.5811388300841898
>>> a1 = numpy.array([[1],[2],[3],[4],[5]])
>>> a1
array([[1],
       [2],
       [3],
       [4],
       [5]])
>>> numpy.var(a1)
array([ 1.58113883])
>>> numpy.std(a1)
array([ 1.58113883])
>>> a =numpy.array([1,2,3,4,5])
>>> numpy.std(a)
1.5811388300841898
>>> numpy.var(a)
1.5811388300841898
>>> numpy.__version__
'0.9.6'



Hanno

-- 
Hanno Klemm
[EMAIL PROTECTED]



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion

Reply via email to