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 →

What to know first

Related concepts

Questions about boolean indexing

What is boolean indexing?

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

Which Manning books explain boolean indexing?

Pandas Workout: 200 exercises to make you a stronger data analyst and Build Python Web Apps with Streamlit.

What should I know before learning boolean indexing?

Manning books that teach boolean indexing usually introduce data frame first.

What is the difference between boolean indexing and query method?

Boolean indexing is a data-selection technique that selects elements or rows at positions where a Boolean condition is true. A pandas DataFrame method that filters rows by evaluating a Boolean expression against the DataFrame's columns.

What is boolean indexing a kind of?

Boolean indexing is a kind of indexing. Indexing is the operation of selecting or accessing elements or regions of an ordered data structure by position, key, or index.

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.