啃书,第二章终于要完结了,还是抠字眼,这些语法、函数的效果如何。
参考文章:
python – 计算 平方,乘方,平方根
Python Number(数字) | 菜鸟教程
Python 内置函数 | 菜鸟教程
import numpy
import math
import time
ss=time.time()
for i in range(100000):
numpy.square(99)
print("numpy.square(99):","\t","\t",time.time()-ss,"\t",numpy.square(99))
ss=time.time()
for i in range(100000):
numpy.power(99,2)
print("numpy.power(99,2):","\t","\t",time.time()