numpy.nanvar()

numpy.nanvar

numpy.nanvar(a, axis=None, dtype=None, out=None, ddof=0, keepdims=False) [source]

Compute the variance along the specified axis, while ignoring NaNs.

Returns the variance of the array elements, a measure of the spread of a distribution. The variance is computed for the flattened array by default, otherwise over the specified axis.

For all-NaN slices or slices with zero degrees of freedom, NaN is returned and a RuntimeWarning is raised.

New in version 1.8.0.

登录查看完整内容