Skip to content

implement .b[] for boolean filtering and raise an error in arr[bool_key] when there is a bool axis #794

Open
@gdementen

Description

@gdementen

As a follow-up to #735, we should actually decide what to do in that case. I am leaning towards this scheme:

if bool larray key:
    if self has a bool axis:
        has_common_axes = len(key.axes & array.axes) >= 1
        if has_common_axes:
            raise ValueError("boolean key is ambiguous because it can target either the array or the boolean axis")
        else:
            # target the bool axis
            <current non bool code>
    else:
        <current bool code>
else:
    <current non bool code>

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions