Github上Pandas,Numpy和 Scipy三个库中20
2016-11-10 本文已影响395人
Datartisan数据工匠
几个月前,我看到一篇博客中列出了 Github 网站上 Python 常用库中使用频率最高的一些函数/模块。我在这个基础上做了可视化处理,并撰写了每个库中使用频率前十的函数示例。其中本文中只包含了部分示例,完整的示例可以参见我的 Github。
首先我利用 requests 和 BeautifulSoup 从原始博客中爬取相关的数据,然后利用 matplotlib 和 seaborn 来绘制条形图,其中函数的排序由包含该函数的资源库(Repositories)数目所决定。比如,虽然 pd.Timestamp 的总频次特别高,但是该函数仅在少量的资源库中出现,所以它的排序相对靠后。
Pandas
![](https://img.haomeiwen.com/i1818544/deeb5c1ca08dfceb.png)
DataFrame: 创建一个 dataframe 对象
![](https://img.haomeiwen.com/i1818544/b1e1bb637037e5dc.png)
merge:联结两个 dataframe
![](https://img.haomeiwen.com/i1818544/8cedd56338a372f8.png)
![](https://img.haomeiwen.com/i1818544/44981100bc189deb.png)
Numpy
![](https://img.haomeiwen.com/i1818544/8441b5eef758c66f.png)
arange: 创建某个区间内等间距的序列数组
![](https://img.haomeiwen.com/i1818544/7a4052d52d5297a0.png)
mean: 沿着某个轴向计算列表/数组中所有数据的平均数
![](https://img.haomeiwen.com/i1818544/680ea1ec27452e2e.png)
Scipy
![](https://img.haomeiwen.com/i1818544/edb35b8278d97f90.png)
stats: 常用的统计函数或分布函数
![](https://img.haomeiwen.com/i1818544/e2a9e49c8122389f.png)
![](https://img.haomeiwen.com/i1818544/e39392d79e352db1.png)
linalg: 常用的线性代数函数,如逆矩阵(linalg.inv)、行列式(linalg.det)
![](https://img.haomeiwen.com/i1818544/c131bec27ef341b0.png)
interpolate: 样条函数和插值函数
![](https://img.haomeiwen.com/i1818544/ef80b1d0ed58f1a7.png)
![](https://img.haomeiwen.com/i1818544/9a788fa6cc965ce6.png)
signal: 包含信号处理工具
![](https://img.haomeiwen.com/i1818544/0bea209eb4309446.png)
![](https://img.haomeiwen.com/i1818544/6bf1cf5a78d5333e.png)
misc: misc.imread 和 misc.imsave 分别用于读取和保存图像数据
![](https://img.haomeiwen.com/i1818544/e1c721f9f86708f6.png)
![](https://img.haomeiwen.com/i1818544/2ae22284857f8f26.png)
最后谢谢各位的阅读,你可以在我的 Github中看到完整的函数示例。
![](https://img.haomeiwen.com/i1818544/11f388f95d245861.png)
原文链接:https://galeascience.wordpress.com/2016/08/10/top-10-pandas-numpy-and-scipy-functions-on-github/
原文作者:Alexander Galea
译者:Fibears