Skip to content

ma.asarray() should pass through objects of the right type #4043

@abalkin

Description

@abalkin

For performance and consistency with np.asarray, ma.asarray should pass through objects that are already of the right type:

>>> x = np.array([])
>>> m = np.ma.array([])
>>> x is np.asarray(x)
True
>>> m is np.ma.asarray(m)
False

Same applies to ma.asanyarray.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions