numpy 1.22.4 Pypi GitHub Homepage
Other Docs
ParametersReturns
asanyarray(a, dtype=None)

If a is a subclass of MaskedArray , its class is conserved. No copy is performed if the input is already an ndarray .

Parameters

a : array_like

Input data, in any form that can be converted to an array.

dtype : dtype, optional

By default, the data-type is inferred from the input data.

order : {'C', 'F'}, optional

Whether to use row-major ('C') or column-major ('FORTRAN') memory representation. Default is 'C'.

Returns

out : MaskedArray

MaskedArray interpretation of a.

Convert the input to a masked array, conserving subclasses.

See Also

asarray

Similar to :None:None:`asanyarray`, but does not conserve subclass.

Examples

This example is valid syntax, but we were not able to check execution
>>> x = np.arange(10.).reshape(2, 5)
... x array([[0., 1., 2., 3., 4.], [5., 6., 7., 8., 9.]])
This example is valid syntax, but we were not able to check execution
>>> np.ma.asanyarray(x)
masked_array(
  data=[[0., 1., 2., 3., 4.],
        [5., 6., 7., 8., 9.]],
  mask=False,
  fill_value=1e+20)
This example is valid syntax, but we were not able to check execution
>>> type(np.ma.asanyarray(x))
<class 'numpy.ma.core.MaskedArray'>
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#7959
type: <class 'function'>
Commit: