Doa*_*Doa 4 python statistics numpy mean scipy
我正在使用scipy的gmean()函数来确定包含电压输出的numpy数组的几何平均值.数字范围介于-80.0和30.0之间.目前,numpy阵列是二维的,给出两个不同测量的电压.
array([[-60.0924, -60.0882],
[-80. , -80. ],
[-80. , -80. ],
...,
[-60.9221, -66.0748],
[-61.0971, -65.9637],
[-61.2706, -65.8803]])
Run Code Online (Sandbox Code Playgroud)
但是,当我采用几何平均值时,我得到NaN:
>>> from scipy import stats as scistats
>>> scistats.gmean(voltages)
array([ NaN, NaN])
Run Code Online (Sandbox Code Playgroud)
有没有人知道可能导致这种情况的原因是什么?难道我做错了什么?
提前致谢!