numpy 1.22.4 Pypi GitHub Homepage
Other Docs
ParametersReturns
is_masked(x)

Accepts any object as input, but always returns False unless the input is a MaskedArray containing masked values.

Parameters

x : array_like

Array to check for masked values.

Returns

result : bool

True if x is a MaskedArray with masked values, False otherwise.

Determine whether input has masked values.

Examples

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

Always returns False if x isn't a MaskedArray.

This example is valid syntax, but we were not able to check execution
>>> x = [False, True, False]
... ma.is_masked(x) False
This example is valid syntax, but we were not able to check execution
>>> x = 'a string'
... ma.is_masked(x) False
See :

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#6569
type: <class 'function'>
Commit: