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

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
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