pandas and NumPy 3 · Selecting and filtering
Filter with a string expression
Write conditions as readable text.
df.query("age > 30 and country == 'UK'")
Official pandas and NumPy 3 documentation
More selecting and filtering commands
All selecting and filtering commands · pandas and NumPy 3 cheatsheet