This is documentation for an old release of NumPy (version 1.6.0). Read this page in the documentation of the latest stable release (version > 1.17).
Returns the average of the array elements.
Masked entries are ignored. The average is taken over the flattened array by default, otherwise over the specified axis. Refer to numpy.mean for the full documentation.
Parameters : | a : array_like
axis : int, optional
dtype : dtype, optional
out : ndarray, optional
|
---|---|
Returns : | mean : ndarray, see dtype parameter above
|
See also
Examples
>>> a = np.ma.array([1,2,3], mask=[False, False, True])
>>> a
masked_array(data = [1 2 --],
mask = [False False True],
fill_value = 999999)
>>> a.mean()
1.5