Skip to content

Masked array set slice fails with np.ma.masked on right side #8624

@taldcroft

Description

@taldcroft

The following behavior is not what I would expect and seems like a bug:

In [1]: x = np.ma.MaskedArray([1,2,3])
In [2]: x[:2] = [100, np.ma.masked]
In [3]: x
Out[3]: 
masked_array(data = [100   0   3],
             mask = False,
       fill_value = 999999)

One can correctly set a single item (e.g. x[2] = np.ma.masked) or set a slice to a scalar (x[:2] = np.ma.masked).

I'm using numpy 1.11.3.

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