UMichigan Applied Plotting, Week 4 Assignment
In this report we analyze ... in Ann Arbor, MI, as compared to statewide statistics. In order to study similar date ranges (1970–2010), we had to resort to data from Washtenaw county, of which Ann Arbor is the seat. This approximation seems to be acceptable: the population of the Ann Arbor metropolitan area was 306,022 in 2010; the same year, the county reported a population of 344,791—a difference of 11.2%.
Datasets were downloaded from the Federal Reserve Bank, St. Louis website. Unfortunately, the website hides the actual URL for the file, so we can only list links to pages from which data can be downloaded (manually or with rather sophisticated web scraping).
We define standard prefixes and variable (AKA column) names for the dataframes we'll be creating. Then, we loop through prefixes (
aa_ for Ann Arbor,
mi_ for Michigan state) and then through column names, reading data from the CSV files. This results in 3 dataframes for each entity. These DFs are indexed by the date of measurements, and their unique column is named after one of the predefined variable
Here, we join the DFs using an 'inner' approach, so we only keep rows (i.e., years) for which we have all the data