how to subset a dataframe in python based on multiple categorical values

Solutions on MaxInterview for how to subset a dataframe in python based on multiple categorical values by the best coders in the world

showing results for - "how to subset a dataframe in python based on multiple categorical values"
Kinsey
11 Apr 2016
1# Select the species and plot columns from the DataFrame
2surveys_df[['species_id', 'plot_id']]
3
4# What happens when you flip the order?
5surveys_df[['plot_id', 'species_id']]
6
7# What happens if you ask for a column that doesn't exist?
8surveys_df['speciess']
9