10000 numpy 1.24.0rc1 gives scalar False in masked_invalid when input is plain array · Issue #22720 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content
numpy 1.24.0rc1 gives scalar False in masked_invalid when input is plain array #22720
Closed
@pllim

Description

@pllim

Is this change intentional? I cannot tell.

As a result of this change, when someone pass in plain array and then try to grab the .mask, it has ndim=0 and the shape no longer matches the input, causing some downstream assumptions to break.

xref astropy/specreduce#153

numpy 1.23.5

>>> import numpy as np
>>> np.ma.masked_invalid([1,2,3])  # Same if I pass in np.array([1,2,3])
masked_array(data=[1, 2, 3],
             mask=[False, False, False],
       fill_value=999999)

numpy 1.24.0rc1

>>> import numpy as np
>>> np.ma.masked_invalid([1,2,3])  # Same if I pass in np.array([1,2,3])
masked_array(data=[1, 2, 3],
             mask=False,
       fill_value=999999)

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

      0