标签:int class .com inf image 对比 分享 处理 nump
def pySum(n): a = list(range(n)) b = list(range(0,3*n,3)) c = [] for i in range(len(a)): c.append(a[i]**2+b[i]**3) return c import numpy def nySum(n): a = numpy.arange(n) b = numpy.arange(0,3*n,3) c = a**2 + b**3 return c import datetime start = datetime.datetime.now() pySum(200000) delta = print(datetime.datetime.now()-start) start1 = datetime.datetime.now() nySum(200000) delta = print(datetime.datetime.now()-start1)
标签:int class .com inf image 对比 分享 处理 nump
原文地址:https://www.cnblogs.com/hodafu/p/9722916.html