numpy.ma.mean(self, axis=None, dtype=None, out=None) =
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 Array containing numbers whose mean is desired. If axis : int, optional Axis along which the means are computed. The default is to compute the mean of the flattened array. dtype : dtype, optional Type to use in computing the mean. For integer inputs, the default is float64; for floating point, inputs it is the same as the input dtype. out : ndarray, optional Alternative output array in which to place the result. It must have the same shape as the expected output but the type will be cast if necessary. |
---|---|
Returns: |
mean : ndarray, see dtype parameter above If |
See also
numpy.ma.mean
numpy.mean
numpy.ma.average
>>> 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
© 2008–2016 NumPy Developers
Licensed under the NumPy License.
https://docs.scipy.org/doc/numpy-1.11.0/reference/generated/numpy.ma.mean.html