TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

PEP 450: Adding A Statistics Module To The Standard Library

185 点作者 petsos将近 12 年前

15 条评论

fiatmoney将近 12 年前
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 未加载
clutchski将近 12 年前
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 未加载
ot将近 12 年前
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 未加载
cabalamat将近 12 年前
&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 未加载
lutusp将近 12 年前
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 未加载
aristus将近 12 年前
About damned time. Writing your own stats library is like writing your own crypto.
评论 #6194253 未加载
zokier将近 12 年前
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>
bachback将近 12 年前
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 未加载
andrewflnr将近 12 年前
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.
bthomas将近 12 年前
One side effect is that this would accelerate the adoption of Python 3 in the scientific community
rev将近 12 年前
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 未加载
tvst将近 12 年前
No mention of Pandas?<p><a href="http://pandas.pydata.org/" rel="nofollow">http:&#x2F;&#x2F;pandas.pydata.org&#x2F;</a>
评论 #6194063 未加载
评论 #6194061 未加载
bayesianhorse将近 12 年前
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...
Demiurge将近 12 年前
I would like having these simple functions, but I think they can just go into &#x27;math&#x27; library.
matiasb将近 12 年前
Nice idea