[Numpy-tickets] [NumPy] #388: Doc error for std in http://scipy.org/Numpy_Example_List#std

NumPy numpy-tickets at scipy.net
Wed Nov 22 09:29:01 CST 2006


#388: Doc error for std in http://scipy.org/Numpy_Example_List#std
----------------------+-----------------------------------------------------
 Reporter:  g2boojum  |       Owner:  somebody
     Type:  defect    |      Status:  new     
 Priority:  normal    |   Milestone:          
Component:  Other     |     Version:          
 Severity:  normal    |    Keywords:          
----------------------+-----------------------------------------------------
 According to the example in http://scipy.org/Numpy_Example_List#std,
 array.std() uses an N-1 normalization
 (and that's what the example shows).  With numpy-1.0 on my machine:

 In [22]: a = array([1., 2., 7.])

 In [23]: a.std()
 Out[23]: 2.62466929134

 In [24]: sqrt(((1.-a.mean())**2 + (2.-a.mean())**2 + (7.-a.mean())**2)/3)
 Out[24]: 2.6246692913372702

 In [25]: sqrt(((1.-a.mean())**2 + (2.-a.mean())**2 + (7.-a.mean())**2)/2)
 Out[25]: 3.214550253664318 <-- That's the result in the example

 Please fix the docs.

-- 
Ticket URL: <http://projects.scipy.org/scipy/numpy/ticket/388>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.


More information about the Numpy-tickets mailing list