You are viewing an older version (2.4.3). Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy 2.4.3 / numpy / ma / core / mean

function

numpy.ma.core:mean

source: /numpy/ma/core.py :7063

Summary

Returns the average of the array elements along given axis.

Extended Summary

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

Refer to numpy.mean for full documentation.

Examples

import numpy as np
a = np.ma.array([1,2,3], mask=[False, False, True])
a
a.mean()

See also

numpy.ma.average

Weighted average.

numpy.mean

Equivalent function

numpy.ndarray.mean

corresponding function for ndarrays

Aliases

  • numpy.ma.mean