query and isin for Clean Filters
Readable filtering for many values.
Toward Cleaner Filters
Long chains of ampersands get hard to read. Two tools, query and isin, make complex filtering far more pleasant. ✨
Filter With a String
The query method lets you describe the filter as plain text, so you skip the repeated df name and bracket noise.
df.query("age > 30")All lessons in this course
- Pick Columns by Name
- Filter Rows With Conditions
- Combine Filters With AND and OR
- query and isin for Clean Filters