ReproduceIt: FiveThirtyEight - How Baltimore’s Young Black Men Are Boxed In

ReproduceIt is a series of articles that reproduce the results from data analysis articles focusing on having open data and open code. All the code and data is available on github: reproduceit-538-baltimore-black-income. This post contains a more verbose version of the content that will probably get outdated while the github version could be updated including fixes.

For this second article I (again) took an article from one of my favorite websites FiveThirtyEight. On this case I took an article by Ben Casselman "How Baltimore’s Young Black Men Are Boxed In" which I found interesting given the recent events in the US, specially on this case Baltimore, Maryland.

The article analyses the income gap between white and black people in different cities all around the US. The data source is the "American Community Survey" and is available in the "American Fact Finder"

With this app is not possible to crawl it like on the previous ReproduciIt article since it requires user input to select the desired data but the data used for this analysis is available with the code in the github repo.

As usual we print some versions of the software and libraries used for future reproducibility.

In [1]:
import sys
sys.version_info
Out[1]:
sys.version_info(major=3, minor=4, micro=3, releaselevel='final', serial=0)
In [2]:
import numpy as np
np.__version__
Out[2]:
'1.9.2'
In [3]:
import pandas as pd
pd.__version__
Out[3]:
'0.16.0'
In [4]:
%matplotlib inline
In [5]:
import matplotlib
import matplotlib.pyplot as plt
plt.style.use('ggplot')

matplotlib.__version__
Out[5]:
'1.4.3'
In [6]:
import bokeh.plotting as plt
from bokeh.models import HoverTool
plt.output_notebook()

import bokeh
bokeh.__version__