Skip to content

Glossary: Probability for ML

np.where

Also written: where

`np.where(condition, x, y)` builds an array that takes each element from x where the condition is True and from y where it is False. It can be used to give different groups different probabilities.

Where the book teaches it

Related terms

Boolean arrayArray