TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

PEP 450: Adding A Statistics Module To The Standard Library

185 pointsby petsosalmost 12 years ago

15 comments

fiatmoneyalmost 12 years ago
It&#x27;s not a terrible idea to support the absolute basics like mean &amp; variance, but anything beyond that (particularly things like models or tests) is not a good idea for a standard library. Once you hit even something simple like a linear regression you have issues of how to represent missing or discrete variables, handling colinearity, or whether to do online or batch modes which can give different results. Tests in particular are fraught because if you&#x27;re going to make them available for general consumption they need a good explanation of when they&#x27;re appropriate, which is basically a semester course in statistics and well out of scope for standard library docs.<p>Basically, the idea of &quot;batteries included&quot; should also mean that if something looks like you can put a D-cell in there, you&#x27;re unlikely to blow your arm off.
评论 #6194393 未加载
评论 #6195456 未加载
评论 #6194380 未加载
评论 #6195245 未加载
clutchskialmost 12 years ago
Batteries included is a fine philosophy when starting a language to encourage early adoption, but at this point, I don&#x27;t think it&#x27;s worth adding new libraries to the stdlib. Here&#x27;s why:<p>- It&#x27;s very easy to find and install third party modules<p>- Once a library is added to stdlib, the API is essentially frozen. This means we can end up stuck with less than ideal APIs (shutil&#x2F;os, urllib2&#x2F;urrlib, etc) or Guido &amp; co are stuck in a time consuming PEP&#x2F;deprecate&#x2F;delete loop for even minor API improvements.<p>- libraries outside of the stdlib are free to evolve. users of those libraries who don&#x27;t want to stay on the bleeding edge are free to stay on old versions.
评论 #6194572 未加载
评论 #6194857 未加载
评论 #6194405 未加载
otalmost 12 years ago
Just out of curiosity, I submitted this yesterday:<p><a href="https://news.ycombinator.com/item?id=6190603" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=6190603</a><p>The URL was<p><pre><code> http:&#x2F;&#x2F;www.python.org&#x2F;dev&#x2F;peps&#x2F;pep-0450&#x2F; </code></pre> While this is<p><pre><code> http:&#x2F;&#x2F;www.python.org&#x2F;dev&#x2F;peps&#x2F;pep-0450 </code></pre> That is, exactly the same except for a trailing slash. Doesn&#x27;t the deduplication algorithm handle this case?
评论 #6194493 未加载
评论 #6195341 未加载
评论 #6195774 未加载
cabalamatalmost 12 years ago
&gt; For many people, installing numpy may be difficult or impossible. For example, people in corporate environments may have to go through a difficult, time-consuming process before being permitted to install third-party software.<p>I do not regard this as a good justification for putting something in the standard library! If you don&#x27;t have root access, use vitualenv (which you might want to do anyway) and install the package somewhere under your home directory.
评论 #6195108 未加载
评论 #6194270 未加载
评论 #6194255 未加载
评论 #6197468 未加载
评论 #6195697 未加载
lutuspalmost 12 years ago
Great idea, but while assembling this library, don&#x27;t leave out permutations, combinations, and the binomial Probability Mass Function (PMF) and Cumulative Distribution Function (CDF). Small overhead, easy to implement, very useful. More here:<p><a href="http://arachnoid.com/binomial_probability" rel="nofollow">http:&#x2F;&#x2F;arachnoid.com&#x2F;binomial_probability</a>
评论 #6194959 未加载
aristusalmost 12 years ago
About damned time. Writing your own stats library is like writing your own crypto.
评论 #6194253 未加载
zokieralmost 12 years ago
Reminds me of the story that made rounds here couple of years ago: The Python Standard Library - Where Modules Go To Die<p><a href="https://news.ycombinator.com/item?id=3913182" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=3913182</a>
bachbackalmost 12 years ago
Nice proposal. I think the problem is numpy itself. If you could just do pip install numeric_package then nobody can complain. I don&#x27;t quite understand why a package has to depend on LINPACK. I will probably switch to julia-lang, because numpy is (at least for me) not that great to work with.
评论 #6194145 未加载
评论 #6194489 未加载
评论 #6194755 未加载
评论 #6194150 未加载
andrewflnralmost 12 years ago
I&#x27;m in favor. I was surprised and annoyed to find there wasn&#x27;t a standard library for doing excel-level statistics. If you throw basic least-squares linear regression in there too, I can eliminate Excel from my physics classes.
bthomasalmost 12 years ago
One side effect is that this would accelerate the adoption of Python 3 in the scientific community
revalmost 12 years ago
Kudos to PHP for apparently being ahead of the curve among dynamic languages with regard to statistics. Another interesting, yet unmentioned option is Clojure&#x2F;Incanter.
评论 #6195890 未加载
评论 #6194505 未加载
tvstalmost 12 years ago
No mention of Pandas?<p><a href="http://pandas.pydata.org/" rel="nofollow">http:&#x2F;&#x2F;pandas.pydata.org&#x2F;</a>
评论 #6194063 未加载
评论 #6194061 未加载
bayesianhorsealmost 12 years ago
I&#x27;m against this. Either you have to create a new statistics module or you would have to include numpy&#x2F;pandas&#x2F;statsmodels into the standard library. In both cases it would essentially freeze the modules for further development outside the python release cycle...
Demiurgealmost 12 years ago
I would like having these simple functions, but I think they can just go into &#x27;math&#x27; library.
matiasbalmost 12 years ago
Nice idea