Compute the standard deviation over the given axis, ignoring nans.
Parameters: | x : array_like
axis : int or None, optional
bias : bool, optional
|
---|---|
Returns: | s : float
|
Examples
>>> from scipy import stats
>>> a = np.arange(10, dtype=float)
>>> a[1:3] = np.nan
>>> np.std(a)
nan
>>> stats.nanstd(a)
2.9154759474226504
>>> stats.nanstd(a.reshape(2, 5), axis=1)
array([ 2.0817, 1.5811])
>>> stats.nanstd(a.reshape(2, 5), axis=None)
2.9154759474226504