On this page
numpy.ma.mean
- ma.mean(self, axis=None, dtype=None, out=None, keepdims=<no value>)=<numpy.ma.core._frommethod object>
-
Returns the average of the array elements along given axis.
Masked entries are ignored, and result elements which are not finite will be masked.
Refer to
numpy.meanfor full documentation.See also
-
numpy.ndarray.mean -
corresponding function for ndarrays
-
numpy.mean -
Equivalent function
-
numpy.ma.average -
Weighted average.
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 -
© 2005–2022 NumPy Developers
Licensed under the 3-clause BSD License.
https://numpy.org/doc/1.23/reference/generated/numpy.ma.mean.html