I would imagine I can find better ways of getting a census dataset indexed by GEOID, but I settled on using the 2015 ACS, which has a web API. This survey has thousands of fields available, all indexed by GEOID.
- Make the directories
./data/
and./data/json/
. These will not be synced by the repo. - Go here and get an API key for the census API. Check your email and copy the key.
- Go to
./build_census_table/
and run the commandpython query_acs.py <API key> population income household tenure marriage education
, where<API key>
is the key you received from the census bureau. Go get coffee while this runs (It should take a few minutes). - Run the command
python build_table.py population income household tenure marriage education
to build the table. This will not take as much time. - Boot up the jupyter notebook
Rename Columns.ipynb
and execute it. This renames the columns to something sensible.
Shape files for every census tract in the US can be found here. I added a script in ./data/shapefiles
to scrape this page for you - all you should have to do is run python get_shapefiles.py
. It is written for mac, but could easily be changed to work on linux. I plan to use the shapefiles for some fun visuals, but I havenn't planned out anything yet.