Compute the mean over the given axis ignoring nans.
x : ndarray
Input array.
axis : int, optional
Axis along which the mean is computed. Default is 0, i.e. the first axis.
m : float
The mean of x, ignoring nans.
See also
nanstd, nanmedian
Examples
>>> from scipy import stats >>> a = np.linspace(0, 4, 3) >>> a array([ 0., 2., 4.]) >>> a[-1] = np.nan >>> stats.nanmean(a) 1.0
Enter search terms or a module, class or function name.