where function¶
(Shortest import: from brian2 import where)
- brian2.units.unitsafefunctions.where(condition, [x, y, ]/)[source]¶
Return elements chosen from
xorydepending oncondition.Note
When only
conditionis 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.