哪个包在Python中具有“统计平均值”功能。我导入scipy和numpy,但收到错误*“ mean”在scipy中不存在*
scipy
和numpy
都具有均值函数。假设您已经在计算机和numpy
环境中正确安装了scipy
和Python
,则可以这样称呼它:
import numpy
import scipy
items = [ 1, 2, 3, 4, 5 ]
numpy_answer = numpy.mean( items )
scipy_answer = scipy.mean( items )
print( numpy_answer )
print( scipy_answer )