[Scipy-tickets] [SciPy] #1650: scipy.stats: inconsistent doc string

SciPy Trac scipy-tickets@scipy....
Thu Apr 26 14:17:52 CDT 2012

#1650: scipy.stats: inconsistent doc string
 Reporter:  nicky        |       Owner:  somebody   
     Type:  enhancement  |      Status:  new        
 Priority:  low          |   Milestone:  Unscheduled
Component:  scipy.stats  |     Version:  0.10.0     
 Keywords:               |  
 The doc string on line (as of date April 16 2012)

 to compute the moments of a distribution is like this:

 _doc_moment = \
 """moment(n, %(shapes)s, loc=0, scale=1)
     Non-central moment of order n

 Thus, a non-central moment should be returned.  On the other hand, the
 code on line


 is as follows:

 def _moment(data, n, mu=None):
     if mu is None:
         mu = data.mean()
     return ((data - mu)**n).mean()

 This computes a central moment, not a non-central moment.

 Besides this, this code is called nowhere within distributions.py. Is it

Ticket URL: <http://projects.scipy.org/scipy/ticket/1650>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.

More information about the Scipy-tickets mailing list