Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ENH: Masked array __array_function__ could "fix" e.g. np.append MA usage #22338

Open
@peland

Description

@peland

Describe the issue:

if I append a masked array and something else using np.append, it returns a masked array but with the original mask replaced with False. I wouldn't mind if it returned a non-masked array (my fault!), but the current behaviour seems positively misleading! If it returns a masked array, it should surely preserve the mask.

Reproduce the code example:

import numpy as np
np.append(np.ma.masked_all(2),np.arange(2))

Error message:

No response

NumPy/Python version information:

1.20.3

Context for the issue:

No longer important for me (I corrected to np.ma.append), but could be misleading for others.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions