This is a pre-release version (latest). Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy latest / numpy / ma / core / getmaskarray

function

numpy.ma.core:getmaskarray

source: build-install/usr/lib/python3.14/site-packages/numpy/ma/core.py :1463

Signature

def   getmaskarray ( arr )

Summary

Return the mask of a masked array, or full boolean array of False.

Extended Summary

Return the mask of arr as an ndarray if arr is a MaskedArray and the mask is not nomask, else return a full boolean array of False of the same shape as arr.

Parameters

arr : array_like

Input MaskedArray for which the mask is required.

Examples

import numpy as np
import numpy.ma as ma
a = ma.masked_equal([[1,2],[3,4]], 2)
a
ma.getmaskarray(a)
Result when mask == ``nomask``
b = ma.masked_array([[1,2],[3,4]])
b
ma.getmaskarray(b)

See also

getdata

Return the data of a masked array as an ndarray.

getmask

Return the mask of a masked array, or nomask.

Aliases

  • numpy.ma.getmaskarray