@np.deprecate(message="<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>")<EOL>def nanstd(x, axis=<NUM_LIT:0>, bias=False):
x, axis = _chk_asarray(x, axis)<EOL>x = x.copy()<EOL>Norig = x.shape[axis]<EOL>mask = np.isnan(x)<EOL>Nnan = np.sum(mask, axis) * <NUM_LIT:1.0><EOL>n = Norig - Nnan<EOL>x[mask] = <NUM_LIT:0.0><EOL>m1 = np.sum(x, axis) / n<EOL>if axis:<EOL><INDENT>d = x - np.expand_dims(m1, axis)<EOL><DEDENT>else:<EOL><INDENT>d = x - m1<EOL><DEDENT>d *= d<EOL>m2 = np.sum(d, axis) - m1 * m1 * Nnan<EOL>if bias:<EOL><INDENT>m2c = m2 / n<EOL><DEDENT>else:<EOL><INDENT>m2c = m2 / (n - <NUM_LIT:1.0>)<EOL><DEDENT>return np.sqrt(m2c)<EOL>
Compute the standard deviation over the given axis, ignoring nans.

Parameters
----------
x : array_like
    Input array.
axis : int or None, optional
    Axis along which the standard deviation is computed. Default is 0.
    If None, compute over the whole array `x`.
bias : bool, optional
    If True, the biased (normalized by N) definition is used. If False
    (default), the unbiased definition is used.

Returns
-------
s : float
    The standard deviation.

See Also
--------
nanmean, nanmedian

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