Skip to content

optimize arr[bool_array] = value #707

Open
@gdementen

Description

@gdementen

When bool_array has many axes and many True values, this can be very slow. This is due to the computation of the target_axes (because this involves combining labels, which is very slow).

It is necessary to do it so that we can broadcast "value" correctly (and check its axes match the target), however there are cases where we can avoid it.

For example, if value is a scalar, we don't need to compute target_axes. More generally, when value does not have any of bool_array.axes, computing target_axes using wildcard axes would be enough.

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