Skip to content

.where for performing masked operations #220

@CGenie

Description

@CGenie

This is a follow-up of #48

(I think boolean arrays are not implemented yet, so this leaves us at integer array with 0 as false, 1 as true)

In numpy one can do:

np.where(condition, x, y)

https://numpy.org/doc/2.2/reference/generated/numpy.where.html

x and y are "array-like" i.e. can be an array or scalar. The result is an array with x where condition is true and y otherwise.

I guess this can be implemented via mapIndexed but it would be nice to have in the stdlib.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions