liveBook · Manning

Boolean indexing

Boolean indexing is a data-selection technique that selects elements or rows at positions where a Boolean condition is true.

How 2 Manning books explain it

Pandas Workout: 200 exercises to make you a stronger data analyst

Boolean-mask indexing selects data elements at positions where a Boolean condition is true.

How it is used
Filters Series and DataFrame values or rows before displaying, counting, aggregating, cleaning, or modifying them.
How deep it goes
Explains Boolean Series creation, .loc selection across both axes, compound conditions, and shape-aware assignment.
Examples
Uses numeric Series, product sales, taxi rides, market prices, and dirty celebrity-age strings.
What you can do after
Apply it via pandas .loc to filter selected rows and columns, count matches, and update matching values.

Read how Pandas Workout: 200 exercises to make you a stronger data analyst explains boolean indexing →

Build Python Web Apps with Streamlit

Boolean indexing is a data-selection technique that filters elements or rows according to Boolean conditions.

How it is used
Deploys Boolean indexing to make dashboard filter panels and date selectors display only matching rows.
How deep it goes
Explains Boolean Series alignment, isin membership tests, vectorization, and combined date conditions without extending beyond DataFrame filtering.
Examples
Demonstrates dropdown selections for age group, gender, category, and state, plus inclusive start-and-end date filtering.
What you can do after
Apply it via pandas to filter DataFrames by selected values or inclusive date conditions.

Read how Build Python Web Apps with Streamlit explains boolean indexing →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.