Skip to content

Size-1 arrays should be indexable by numpy.bool_ objects (Trac #823) #1421

@numpy-gitbot

Description

@numpy-gitbot

Original ticket http://projects.scipy.org/numpy/ticket/823 on 2008-06-17 by @teoliphant, assigned to unknown.

The numpy.bool_ scalar should be allowed for masked-indexing of size-1 arrays. Currently, if x is a 0-d array, then x>3 is a numpy.bool_ objects and for a 0-d array y[x>3] will fail, while it should succeed as if numpy.bool_ were a 0-d array of boolean datatype.

This is related to Ticket #1319. There are some questions about whether or not 0-d arrays should be be "maskable". I think they should be maskable and return a size-0 array if the mask does not succeed.

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