pandas and NumPy 3 · Selecting and filtering

Select by label

Select rows and columns by label with loc.

df.loc[df["age"] > 30, ["name", "age"]]

Official pandas and NumPy 3 documentation

More selecting and filtering commands

All selecting and filtering commands · pandas and NumPy 3 cheatsheet

Was this page helpful?