hanzhichao2000 最近的时间轴更新
hanzhichao2000

hanzhichao2000

V2EX 第 88994 号会员,加入于 2014-12-29 15:47:42 +08:00
hanzhichao2000 最近回复了
2017-10-13 09:38:43 +08:00
回复了 rogwan 创建的主题 Python 相比 Python 代码, Cython 实际提升的性能有多大?
如果涉及数值计算的话,numba 可能用起来更方便,cython 毕竟还要显性配置些东西
2017-10-13 09:20:20 +08:00
回复了 rogwan 创建的主题 Python 相比 Python 代码, Cython 实际提升的性能有多大?
Ref: http://notes-on-cython.readthedocs.io/en/latest/std_dev.html

Example:

def pyStdDev(a):
mean = sum(a) / len(a)
return math.sqrt((sum(((x - mean)**2 for x in a)) / len(a)))


In summary:

================= ============ ================== =====================
Method Time (ms) Compared to Python Compared to Numpy
================= ============ ================== =====================
Pure Python 183 x1 x0.03
Numpy 5.97 x31 x1
Naive Cython 7.76 x24 x0.8
Optimised Cython 2.18 x84 x2.7
Cython calling C 2.22 x82 x2.7
================= ============ ================== =====================
- bitbucket 可以免费放私有代码
- yandex disk 试试看?
2016-09-07 18:37:20 +08:00
回复了 zmrenwu 创建的主题 Python 1 亿条数据如何使用 Pandas 去重?
blaze 或 dask ,语法类似 pandas ,比数据库和 Hadoop 都轻
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1221 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 12ms · UTC 18:15 · PVG 02:15 · LAX 11:15 · JFK 14:15
Developed with CodeLauncher
♥ Do have faith in what you're doing.