This is a general repo for code and data related to a TDA project studying the 2015 and 2019 Chicago mayoral elections using the Mapper algorithm as implemented by Kepler Mapper with our own fork MGGG Kepler Mapper. Other project-related code is in the MGGG Summer 2023 repo. in directories beginning with the prefix tda-
acs_tables/
all of the ACS 2018 detailed tables aggregated on blockgroups in Cook County used for this codeprecincts_shapefile/
shapefile for Chicago's 2012 precincts, (source)tl_2010_17031_bg10/
,tl_2010_17031_tabblock10/
2010 census blockgroup and block shapefiles for Cook County10decPL_chicago_blocks_raw.csv
tables P1, P2, P3, P4 and H1 from the 2010 PL redistricting data on blocks in Cook County10decPL_chicago_blocks_summary.csv
summarized race computed categories for population over 18 computed from above data. See~/summarize_pl.py
for the computation.10decPL_chicago_blocks_summary_pct.csv
same but as percents of VAPacs_dataset_bgs.csv
several variables computed fromacs_tables
on blockgroups in Cook County. See~/notebooks/get_new_acs_dataset.ipynb
for detailsChicago_mayoral.csv
dataset with demographic and mayoral election columns with little known provenancechicago_mayoral_with_ro_pct.csv
above with runoff columns as percents of total voteenriched_chicago_mayoral.csv
above with normalized geographic variables + first round vote normalized so that Garcia vote percent and Rahm vote percent sum to 1chicago_mayoral_acs_counts.csv
above joined with variables fromacs_dataset_bgs.csv
after being disaggregated onto blocks then reaggregated onto precinctschicago_mayoral_acs_counts.csv
above with acs columns normalized in per case wayschicago_2015_mayoral_runoff.csv
clean election results from the chicago election commission for verifying the correctness ofChicago_mayoral.csv
initial_exploratory.ipynb
originial exploratory notebook for applying Mapper to Chicago mayoral election data + race. Also includes first attempt at map based vizualizationget_new_acs_dataset.ipynb
code usingdata/acs_tables
for computing summary variables, disaggregating them to blocks, aggregating them back up to precincts and joining them onto existing dataaggregate_pl_to_precincts.ipynb
code to aggregate PL redistricting race data onto precinctsbaby_mapper_mapper.ipynb
extracted map viz from original exploratory notebook to take first step to making it modularbaby_mapper_mapper_distrib/
directory with everything needed to runbaby_mapper_mapper
notebook
mapper_boilerplate.py
mildly structured example script for our mapper pipelinetmap_boilerplate.py
attempt at doing the above for tmap library, in particular to use their SAFE computations