[Python-Dev] Re: [Python-checkins] python/nondist/sandbox/statistics statistics.py, NONE, 1.1 test_statistics.py, NONE, 1.1

Skip Montanaro skip at pobox.com
Mon Feb 23 12:10:14 EST 2004


    Raymond> The module focuses on everyday data reduction functions and
    Raymond> omits more sophisticated statistical tools.

    ...

    Raymond> __all__ = ['mean', 'stddev', 'product', 'nlargest',
    Raymond>            'nsmallest', 'select']

Raymond 

It's been years since I last looked at a statistics book or thought much
about statistics, but I think the standard deviation was generally defined
as the square root of the variance.  Perhaps you could easily add the
variance to your collection of functions by renaming "stddev" to "variance",
remove the "** 0.5" from the return statements, then define stddev as

    def stddev(data, sample=True):
        return variance(data, sample) ** 0.5

Skip



More information about the Python-Dev mailing list