I am using scipy's gmean() function to determine the geometric mean of a numpy array that contains voltage outputs. The range of the numbers is between -80.0 and 30.0. Currently, the numpy array is two dimensional, giving the voltage for two different measurements.
array([[-60.0924, -60.0882],
[-80. , -80. ],
[-80. , -80. ],
...,
[-60.9221, -66.0748],
[-61.0971, -65.9637],
[-61.2706, -65.8803]])
However, I get NaN when I take the geometric mean:
>>> from scipy import stats as scistats
>>> scistats.gmean(voltages)
array([ NaN, NaN])
Does anybody have an idea what might be causing this? Am I doing something wrong?
Thanks in advance!
The geometric mean cannot be applied to negative values.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With