[Python-ideas] Pre-PEP: adding a statistics module to Python

Oscar Benjamin oscar.j.benjamin at gmail.com
Mon Aug 5 18:23:35 CEST 2013


On 5 August 2013 17:14, Andrew McNabb <amcnabb at mcnabbs.org> wrote:
> On Sun, Aug 04, 2013 at 05:51:45AM -0700, Eli Bendersky wrote:
>>
>> Efforts are better spent in writing a new tutorial on Numpy that shows
>> how to do the stuff statistics.py does. Call it "Numpy statistics for
>> the average person".
>
>> [Sorry to have beaten on this average thing so much; patronization
>> drives me mad]
>
> As someone who uses numpy heavily, I think that Numpy is no replacement
> for having a basic statistics module in the standard library.  Numpy is
> heavy in dependencies (Fortran, LAPACK, etc.), in load time, and
> conceptually.  It is difficult to install from source, so it's
> unavailable on many systems with Python.  Numpy is great, but it
> involves enough commitment that it's not something to rely on casually.
>
> I use Numpy all the time, but I would also use a stats library in the
> standard library.

I'd like to second Andrew's points. I wouldn't normally consider a
Python installation complete until numpy and many others are installed
but that doesn't mean I wouldn't use this or that it shouldn't be in
tte stdlib.

To offer two particular ways in which Steven's library is better than
numpy's stats functions even if they are available:
1) It can work with iterators in some cases where numpy would require
a concrete collection.
2) It can take advantage of Python's infinite range and
infinite/arbitrary precision numeric types: integer, Decimal and
Fraction in cases where numpy would just coerce everything to float.


Oscar


More information about the Python-ideas mailing list