where function
(Shortest import: from brian2 import where)
- brian2.units.unitsafefunctions.where(condition, [x, y, ]/)[source]
Return elements chosen from
x
ory
depending oncondition
.Note
When only
condition
is provided, this function is a shorthand fornp.asarray(condition).nonzero()
. Usingnonzero
directly should be preferred, as it behaves correctly for subclasses. The rest of this documentation covers only the case where all three arguments are provided.