<jupyter_start><jupyter_text>Area Deprivation Index Found [here](https://www.neighborhoodatlas.medicine.wisc.edu/).From the Neighborhood Atlas site:"The Area Deprivation Index (ADI) is based on a measure created by the Health Resources & Services Administration (HRSA) over two decades ago for primarily county-level use, but refined, adapted, and validated to the Census block group/neighborhood level by <NAME>, MD, PhD and her research team at the University of Wisconsin-Madison. It allows for rankings of neighborhoods by socioeconomic status disadvantage in a region of interest (e.g. at the state or national level). It includes factors for the theoretical domains of income, education, employment, and housing quality. It can be used to inform health delivery and policy, especially for the most disadvantaged neighborhood groups."<jupyter_code>wi_adi = pd.read_csv(os.path.join("../../wi_bg_v1.5.txt"),delimiter=",")
wi_adi['FIPS'] = wi_adi['FIPS'].astype(str)
wi_adi.head()
sns.distplot(wi_adi['ADI_NATRANK'],kde=False,label='National Percentile')
sns.distplot(wi_adi['ADI_STATERNK']*10.0,kde=False,label='State Decile')
plt.legend()<jupyter_output><empty_output><jupyter_text>It looks like we'll get more detail out of the National ADI percentiles than the State-level deciles.  Census ShapefilesLink the FIPS codes in the ADI data to their corresponding spatial boundaries so the shapes and the data are in the same dataframe.<jupyter_code>wi_shp = gpd.read_file(os.path.join('../../gz_2010_55_150_00_500k/gz_2010_55_150_00_500k.shp'))
wi_shp.head()<jupyter_output><empty_output><jupyter_text>It looks like the column 'GEO_ID' has the 12-digit FIPS codes following the letters 'US'. Create a new column with just the 12-digit FIPS codes.<jupyter_code>wi_shp['FIPS'] = wi_shp['GEO_ID'].apply(lambda x: x.split("US")[-1])

# Just subset to Dane County:
dane = wi_shp[wi_shp['COUNTY']=='025']
# Join ADI to the Dane county dataframe:
adi_dane = dane[['FIPS','CENSUSAREA','geometry','TRACT']].merge(wi_adi,how='left',on='FIPS')
adi_dane.head()
# THere are two tracts without ADI data - let's drop those from the dataframe
print("Was",len(adi_dane))
adi_dane = adi_dane[adi_dane['CENSUSAREA']>0.0]
print("Is",len(adi_dane))
sns.distplot(adi_dane['ADI_NATRANK'])
geoplot.choropleth(adi_dane,hue='ADI_NATRANK',cmap='Blues',k=None,legend=True,figsize=(11,8))<jupyter_output><empty_output>