Exercise

Rent Burden in San Francisco

In this exercise, you will look at rent burden (households paying 30% or more of their income in rent) in San Francisco, one of the highest price housing markets in the country.

The rent DataFrame contains the number of households in each of 7 income categories crossed with 8 rent-share-of-income categories. For each income category, You will use a loop to calculate the percentage of rent burdened households in each income category. The column name prefixes associated with each income category are in a list:

incomes = ["inc_under_10k", "inc_10k_to_20k", "inc_20k_to_35k", "inc_35k_to_50k",
           "inc_50k_to_75k", "inc_75k_to_100k", "inc_over_100k"]

pandas and seaborn are imported using the usual aliases.

Instructions 1/3

undefined XP
    1
    2
    3
  • Add the columns that count rent burdened households; these column names begin with income and end with "_rent_30_to_35_pct", "_rent_35_to_40_pct", "_rent_40_to_50_pct", and "_rent_over_50_pct".