8000 BUG: Masked scalar comparison returns float · Issue #4332 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

BUG: Masked scalar comparison returns float #4332

@abalkin

Description

@abalkin
>>> (numpy.ma.array(5.5, mask=True) > 0).dtype
dtype('float64')

Moreover, the result has float dtype even if the masked scalar is an int:

>>> (numpy.ma.array(5, dtype='i', mask=True) < 0).dtype
dtype('float64')

The problem is not present in oldnumeric:

>>> (numpy.oldnumeric.ma.array(5.5, mask=True) < 0).dtype
dtype('bool')
>>> numpy.__version__
'1.8.0'

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