bundles / numpy 2.4.4 / numpy / ma / core / getdata
function
numpy.ma.core:getdata
source: /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_likeInput
MaskedArray, alternatively a ndarray or a subclass thereof.subok: boolWhether to force the output to be a
purendarray (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