Skip to content

what to do when a variable is sliced with an all False Boolean index array? #1200

@jswhit

Description

@jswhit

Current behavior:

  1. for a 1D variable an empty array is returned
  2. for multi-dim variables an opaque exception is raised.
  3. for numpy arrays, an empty array is always returned

Two potential solutions:

  1. PR Added more descriptive error message if indexing with all False bool … #1197: always return an exception with a more informative error message
  2. PR return empty array if boolean index array is all False #1198: always silently return an empty array (as numpy does)

Which one do you prefer?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions