from numpy import *
np.log(1.1, 2)
上面这段代码在运行时会出现
TypeError: return arrays must be of ArrayType的错误,因为log的第二个参数不是base而是out array。如果你只是想执行普通的log操作,可以选择使用numpy.math.log(1.1, 2)或者使用python自带的math模块的log函数
from numpy import *
np.log(1.1, 2)
上面这段代码在运行时会出现
TypeError: return arrays must be of ArrayType的错误,因为log的第二个参数不是base而是out array。如果你只是想执行普通的log操作,可以选择使用numpy.math.log(1.1, 2)或者使用python自带的math模块的log函数