Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #52301

Re: PEP 450 Adding a statistics module to Python

From Roy Smith <roy@panix.com>
Newsgroups comp.lang.python
Subject Re: PEP 450 Adding a statistics module to Python
Date 2013-08-10 07:50 -0400
Organization PANIX Public Access Internet and UNIX, NYC
Message-ID <roy-AC630E.07502310082013@news.panix.com> (permalink)
References <520592f9$0$30000$c3e8da3$5496439d@news.astraweb.com> <mailman.417.1376104455.1251.python-list@python.org>

Show all headers | View raw


In article <mailman.417.1376104455.1251.python-list@python.org>,
 Skip Montanaro <skip@pobox.com> wrote:

> Given that installing numpy or scipy is generally no more difficult
> that executing "pip install (scipy|numpy)" I'm not really feeling the
> need for a battery here...

I just tried installing numpy in a fresh virtualenv on an Ubuntu Precise 
box.  I ran "pip install numpy".  It took 1.5 minutes.  It printed 
almost 1800 lines of build crap, including 383 warnings and 83 errors.  
For a newbie, that can be pretty intimidating.

That's for the case where I've already installed numpy elsewhere on that 
box, so I already had the fortran compiler, and the rest of the build 
chain.  For fun, I just spun up a new Ubuntu Precise instance in AWS.  
It came pre-installed with Python 2.7.3.  I tried "pip install numpy", 
which told me that pip was not installed.

At least it told me what I needed to do to get pip installed.  
Unfortunately, I didn't read the message carefully enough and typed 
"sudo apt-get install pip", which of course got me another error because 
the correct name of the package is python-pip.  Doing "sudo apt-get 
install python-pip" finally got me to the point where I could start to 
install numpy.

Of course, if I didn't have sudo privs on the box (most corporate 
environments), I never would have gotten that far.

At this point, "sudo pip install numpy" got me a bunch of errors 
culminating in "RuntimeError: Broken toolchain: cannot link a simple C 
program", and no indication of how to get any further.

At this point, most people would give up.  I don't remember the full set 
of steps I needed to do the first time.  Obviously, I would start with 
installing gcc, but I seem to remember there were additional steps 
needed to get fortran support.

Having some simple statistics baked into the standard python package 
would be a big win.  As shown above, installing numpy can be an 
insurmountable hurdle for people with insufficient sysadmin-fu.

PEP-450 makes cogent arguments why rolling your own statistics routines 
is fraught with peril.  Looking over our source tree, I see we've 
implemented std deviation in python at least twice. I'm sure they're 
both naive implementations of the sort PEP-450 warns about.

And, yes, backporting to 2.7 would be a big win too.  I know the goal is 
to get everybody onto 3.x, but my pip external dependency list includes 
40 modules.  It's going to be a long and complicated road to get to the 
point where I can move to 3.x, and I imagine most non-trivial projects 
are in a similar situation.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

PEP 450 Adding a statistics module to Python Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-08-10 01:10 +0000
  Re: PEP 450 Adding a statistics module to Python Skip Montanaro <skip@pobox.com> - 2013-08-09 22:14 -0500
    Re: PEP 450 Adding a statistics module to Python Roy Smith <roy@panix.com> - 2013-08-10 07:50 -0400
      Re: PEP 450 Adding a statistics module to Python Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-08-10 13:23 +0100
        Re: PEP 450 Adding a statistics module to Python Roy Smith <roy@panix.com> - 2013-08-10 08:43 -0400
          Re: PEP 450 Adding a statistics module to Python Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-08-10 14:17 +0100
  Re: PEP 450 Adding a statistics module to Python Ben Finney <ben+python@benfinney.id.au> - 2013-08-10 15:05 +1000
  Re: PEP 450 Adding a statistics module to Python Stefan Behnel <stefan_ml@behnel.de> - 2013-08-10 09:55 +0200
  Re: PEP 450 Adding a statistics module to Python Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-08-10 16:19 -0400
  Re: PEP 450 Adding a statistics module to Python Skip Montanaro <skip@pobox.com> - 2013-08-11 06:50 -0500
    Re: PEP 450 Adding a statistics module to Python Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-08-11 13:33 +0000
    Re: PEP 450 Adding a statistics module to Python Roy Smith <roy@panix.com> - 2013-08-11 10:02 -0400
      Re: PEP 450 Adding a statistics module to Python duncan smith <buzzard@invalid.invalid> - 2013-08-11 16:44 +0100
  Re: PEP 450 Adding a statistics module to Python Nicholas Cole <nicholas.cole@gmail.com> - 2013-08-11 13:27 +0100
  Re: PEP 450 Adding a statistics module to Python Wolfgang Keller <feliphil@gmx.net> - 2013-08-13 20:14 +0200
    Re: PEP 450 Adding a statistics module to Python Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-08-13 19:44 +0100
    Re: PEP 450 Adding a statistics module to Python Steven D'Aprano <steve@pearwood.info> - 2013-08-14 06:21 +0000
  Re: PEP 450 Adding a statistics module to Python CM <cmpython@gmail.com> - 2013-08-14 21:26 -0700
    RE: PEP 450 Adding a statistics module to Python "Prasad, Ramit" <ramit.prasad@jpmorgan.com.dmarc.invalid> - 2013-08-16 19:17 +0000
  Re: PEP 450 Adding a statistics module to Python taldcroft@cfa.harvard.edu - 2013-08-16 08:50 -0700
    Re: PEP 450 Adding a statistics module to Python chris.barker@noaa.gov - 2013-08-16 09:31 -0700
      Re: PEP 450 Adding a statistics module to Python Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-08-16 18:15 +0100
        Re: PEP 450 Adding a statistics module to Python chris.barker@noaa.gov - 2013-08-16 12:00 -0700
          Re: PEP 450 Adding a statistics module to Python Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-08-16 20:41 +0100
      Re: PEP 450 Adding a statistics module to Python Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-08-16 18:51 +0000
        Re: PEP 450 Adding a statistics module to Python chris.barker@noaa.gov - 2013-08-16 12:48 -0700
    Re: PEP 450 Adding a statistics module to Python Roy Smith <roy@panix.com> - 2013-08-16 22:06 -0400
      Re: PEP 450 Adding a statistics module to Python Josef Pktd <josef.pktd@gmail.com> - 2013-08-17 05:13 -0700
  Re: PEP 450 Adding a statistics module to Python Jason Friedman <jsf80238@gmail.com> - 2013-08-17 21:57 -0600

csiph-web