AI engineering glossary · NumPy pandas visualization
What is boolean mask?
Boolean mask (also called boolean indexing in NumPy): An array of True and False values with the same shape as another array, used to select only the elements where the mask is True. It is built by applying a comparison to the whole array and is the main way to filter numerical data without a loop.
Boolean mask: an example
scores[scores > 60] returns only the scores above 60, and (scores > 60).sum() counts how many there are.
Related terms
More NumPy pandas visualization terms
- Box plot
- Broadcasting
- C order
- Categorical dtype
- Chunked reading
- Colormap
- Colour-blind-safe palette
- Concatenate
Where you learn it
Boolean mask is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.