To provide the most recent news and documentation www.pymvpa.org reflects the development 2.0 series (renamed 0.6 series) of PyMVPA. If you are interested in the documentation of the previous stable 0.4 series of PyMVPA, please visit v04.pymvpa.org.

mvpa2.clfs.transerror.nanmean

mvpa2.clfs.transerror.nanmean(x, axis=0)

Compute the mean over the given axis ignoring nans.

Parameters :

x : ndarray

Input array.

axis : int, optional

Axis along which the mean is computed. Default is 0, i.e. the first axis.

Returns :

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

NeuroDebian

NITRC-listed