Session Ready
Exercise

Combo-attack!

You've seen the four most common types of data manipulation: sorting rows, subsetting columns, subsetting rows, and adding new columns. In a real-life data analysis, you can mix and match these four manipulations to answer a multitude of questions.

In this exercise, you'll answer the question, "Which state has the highest number of homeless individuals per 10,000 people in the state?" Combine your new pandas skills to find out.

Instructions
100 XP
  • Add a column to homelessness, indiv_per_10k, containing the number of homeless individuals per ten thousand people in each state.
  • Subset rows where indiv_per_10k is higher than 20, assigning to high_homelessness.
  • Sort high_homelessness by descending indiv_per_10k, assigning to high_homelessness_srt.
  • Select only the state and indiv_per_10k columns of high_homelessness_srt and save as result. Look at the result.