numpy 1.22.4 Pypi GitHub Homepage
Other Docs
ParametersRaisesReturnsBackRef
masked_all_like(arr)

Return an empty masked array of the same shape and dtype as the array :None:None:`arr`, where all the data are masked.

Parameters

arr : ndarray

An array describing the shape and dtype of the required MaskedArray.

Raises

AttributeError

If :None:None:`arr` doesn't have a shape attribute (i.e. not an ndarray)

Returns

a : MaskedArray

A masked array with all data masked.

Empty masked array with the properties of an existing array.

See Also

masked_all

Empty masked array with all elements masked.

Examples

>>> import numpy.ma as ma
... arr = np.zeros((2, 3), dtype=np.float32)
... arr array([[0., 0., 0.], [0., 0., 0.]], dtype=float32)
>>> ma.masked_all_like(arr)
masked_array(
  data=[[--, --, --],
        [--, --, --]],
  mask=[[ True,  True,  True],
        [ True,  True,  True]],
  fill_value=1e+20,
  dtype=float32)

The dtype of the masked array matches the dtype of :None:None:`arr`.

>>> arr.dtype
dtype('float32')
>>> ma.masked_all_like(arr).dtype
dtype('float32')
See :

Back References

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

numpy.ma.extras.masked_all

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/extras.py#156
type: <class 'function'>
Commit: