numpy.ma.MaskedArray.mean#

method

ma.MaskedArray.mean(axis=None,dtype=None,out=None,keepdims=<novalue>)[source]#

Returns the average of the array elements along given axis.

Masked entries are ignored, and result elements which are notfinite will be masked.

Refer tonumpy.mean for full documentation.

See also

numpy.ndarray.mean

corresponding function for ndarrays

numpy.mean

Equivalent function

numpy.ma.average

Weighted average.

Examples

>>>importnumpyasnp>>>a=np.ma.array([1,2,3],mask=[False,False,True])>>>amasked_array(data=[1, 2, --],             mask=[False, False,  True],       fill_value=999999)>>>a.mean()1.5
On this page