[Python-ideas] Pre-PEP: adding a statistics module to Python
Oscar Benjamin
oscar.j.benjamin at gmail.com
Mon Aug 5 01:38:04 CEST 2013
On 2 August 2013 18:45, Steven D'Aprano <steve at pearwood.info> wrote:
> I have raised an issue on the tracker to add a statistics module to Python's
> standard library:
>
> http://bugs.python.org/issue18606
>
> and have been asked to write a PEP. Attached is my draft PEP. Feedback is
> requested, thanks in advance.
Excellent work Steven! If I had a penny for every time I rolled-my-own
mean() I could buy you a drink or two to thank you for this (actually
at current UK prices one pint would be a stretch but we could call it
two and I'd cover the difference!).
I've just begun to look at the PEP but I've already noticed one thing
that seems to be missing from the rationale (and from this email
thread). There is much discussion about numpy/scipy as the obvious way
to get stats functions and why some users might not want to
install/use them. A significant point that is worth mentioning is that
numpy/scipy are CPython-specific. There is the numpypy project that
aims to bridge part of this gap between CPython and pypy but it's
incomplete and I don't know of similar efforts for the other Python
implementations. There may be alternative libraries that expose stats
functions for Jython etc, but AFAIK there's currently no decent
cross-implementation solution for even basic stats like the mean. Your
proposal would rectify that problem and it should say this in the PEP.
(Expect a more detailed response to the proposal/implementation in the
next few days.)
Oscar
More information about the Python-ideas
mailing list