numpy 1.22.4 Pypi GitHub Homepage
Other Docs
ParametersBackRef
getmask(a)

Return the mask of a as an ndarray if a is a MaskedArray and the mask is not :None:None:`nomask`, else return :None:None:`nomask`. To guarantee a full array of booleans of the same shape as a, use getmaskarray .

Parameters

a : array_like

Input MaskedArray for which the mask is required.

Return the mask of a masked array, or nomask.

See Also

getdata

Return the data of a masked array as an ndarray.

getmaskarray

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

Examples

This example is valid syntax, but we were not able to check execution
>>> import numpy.ma as ma
... a = ma.masked_equal([[1,2],[3,4]], 2)
... a masked_array( data=[[1, --], [3, 4]], mask=[[False, True], [False, False]], fill_value=2)
This example is valid syntax, but we were not able to check execution
>>> ma.getmask(a)
array([[False,  True],
       [False, False]])

Equivalently use the MaskedArray :None:None:`mask` attribute.

This example is valid syntax, but we were not able to check execution
>>> a.mask
array([[False,  True],
       [False, False]])

Result when mask == :None:None:`nomask`

This example is valid syntax, but we were not able to check execution
>>> b = ma.masked_array([[1,2],[3,4]])
... b masked_array( data=[[1, 2], [3, 4]], mask=False, fill_value=999999)
This example is valid syntax, but we were not able to check execution
>>> ma.nomask
False
This example is valid syntax, but we were not able to check execution
>>> ma.getmask(b) == ma.nomask
True
This example is valid syntax, but we were not able to check execution
>>> b.mask == ma.nomask
True
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

numpy.ma.core.getmaskarray numpy.ma.core.getdata

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /numpy/ma/core.py#1355
type: <class 'function'>
Commit: