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

bundles / numpy latest / numpy / ma / core / getdata

function

numpy.ma.core:getdata

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

Signature

def   getdata ( a subok = True )

Summary

Return the data of a masked array as an ndarray.

Extended Summary

Return the data of a (if any) as an ndarray if a is a MaskedArray, else return a as a ndarray or subclass (depending on subok) if not.

Parameters

a : array_like

Input MaskedArray, alternatively a ndarray or a subclass thereof.

subok : bool

Whether to force the output to be a pure ndarray (False) or to return a subclass of ndarray if appropriate (True, default).

Examples

import numpy as np
import numpy.ma as ma
a = ma.masked_equal([[1,2],[3,4]], 2)
a
ma.getdata(a)
Equivalently use the ``MaskedArray`` `data` attribute.
a.data

See also

getmask

Return the mask of a masked array, or nomask.

getmaskarray

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

Aliases

  • numpy.ma.getdata