【发布时间】:2019-04-15 23:01:26
【问题描述】:
结果是大小为 300000 的 2d numpy 数组
for i in range(np.size(results,0)):
if results[i][0]>=0.7:
count+=1
在这个 python 代码中我需要 0.7 秒,但我在 C++ 代码中运行它,它需要不到 0.07 秒。
那么如何让这段python代码尽可能快呢?
【问题讨论】:
标签: python arrays performance numpy