1. Learn
  2. /
  3. Courses
  4. /
  5. Analyzing US Census Data in Python

Exercise

Characteristics of Segregated Metros

So, you've determined that segregation is higher in Northern industrialized metro areas. But these are also large, diverse metro areas. Are low diversity cities just getting a pass? Let's compare how size and diversity correlate with metropolitan segregation.

The msa DataFrame, as modified previously with the addition of the Index of Dissimilarity, has been loaded. The columns are listed in the console. Total population appears in the population column.

pandas and seaborn have been loaded using the usual aliases.

Instructions

100 XP
  • Plot segregation on the y-axis vs. metropolitan population on the x-axis
  • Calculate the percentage African-American, and assign to column black_pct
  • Plot segregation vs. percentage African-American
  • Create a scatterplot of segregation vs. percentage African-American. Add the size and hue parameters, both set to the column "population"