向量化數據的相比於for循環的優勢

例子 import numpy as np import time a = np.random.rand(1000000) b = np.random.rand(1000000) tic = time.time() c = np.dot(a,b) toc = time.time() print© print(「vectorized version:」 + str((toc-tic))+「s」) c
相關文章
相關標籤/搜索