BW #89: Housing
The US election campaign ends in another two weeks, and one of the biggest issues among the electorate is the cost of housing. The problem with housing, from a variety of articles I've read, stems from too little supply. But of course, it's not quite that simple; an episode of NPR's Planet Money from August (https://www.npr.org/2024/08/30/1197961522/minneapolis-minnesota-housing-2040-tim-walz) describes how Minneapolis, Minnesota worked to incentivize the construction and renovation of homes, only to find that solving these problems can be challenging, even with the best of intentions.
This week, I thus decided to look through data on new housing construction in the United States. We'll be able to see how many homes are being constructed, where that construction is taking place, and what kinds of homes are being built. Along the way, of course, we'll have a chance to work with a variety of Pandas features.
Data and seven questions
This week's data comes from the US Census Bureau, whose "survey of construction" looks at new (not renovated or resold) homes. They offer a variety of data sets, all from this page:
https://www.census.gov/construction/nrc/data/series.html
We will look at only two of these data sets:
- Housing units started, https://www.census.gov/construction/nrc/xls/starts_cust.xlsx
- Housing units completed, https://www.census.gov/construction/nrc/xls/comps_cust.xlsx
This week, I have seven tasks and questions about this data. The learning goals include working with Excel files, joins, string manipulation, time series, multi-indexes, and plotting.
I'll be back tomorrow with my full solutions and explanations, including the Jupyter notebook I used to solve these problems.
- Create two data frames, one from each of the two Excel files references above, on the "Annual" tab in both files. The columns should be a two-level multi-index. Values labeled
(NA)
should be turned intoNaN
. Ignore the header and footer information. The index (rows) should contain the year from the first column. - Create a line plot showing total housing starts and completions in the overall United States. Show starts with a dashed blue line, and completed houses with a solid red line. When did the most recent big changes in the housing market take place?