[ Web Proxy ]
URL:
Viewing: https://numpy.org/doc/stable/reference/generated/../random/../generated/numpy.ma.anom.html [Back]  [Original]

numpy.ma.anom — NumPy v2.5 Manual
Back to top
Search the docs ...:

numpy.ma.anom#

ma.anom(self, axis=None, dtype=None)[source]#

Compute the anomalies (deviations from the arithmetic mean) along the given axis.

Returns an array of anomalies, with the same shape as the input and where the arithmetic mean is computed along the given axis.

Parameters:
axisint, optional

Axis over which the anomalies are taken. The default is to use the mean of the flattened array as reference.

dtypedtype, optional

Type to use in computing the variance. For arrays of integer type the default is float32; for arrays of float types it is the same as the array type.

See also

mean

Compute the mean of the array.

Examples

Try it in your browser!
>>> import numpy as np
>>> a = np.ma.array([1,2,3])
>>> a.anom()
masked_array(data=[-1.,  0.,  1.],
             mask=False,
       fill_value=1e+20)

Web Proxy Viewer  |  New URL  |  Original Page