This repository contains four parts:
/NC
folder contains North Carolina's shapefiles./figures
folder contains all graphs we generated for this project, including graphs for outlier analysis and short burst./short_burst
folder contains code for running short burst.- Two jupyter notebooks (
NC_recom.ipynb
,data_cleaning.ipynb
) and two python files (gerrychainNC.py
,map_details.py
).
This notebook is for cleaning up and repair North Carolina shapefiles and adding elections into the shapefiles, resulting shapefile can be found in /NC
folder and it is ready to use for gerrychain.
This notebook is for running shapefile generated from data_cleaning.ipynb
on gerrychain and generate boxplot for the signature of gerrymandering.
This file runs gerrychain on NC shapefile, does ensemble analysis for cutting edges, efficiency gap, mean median difference, partisan bias ,and democratic won and generate graphs
This file is to calculate cutting edges, efficiency gap, mean median difference, partisan bias and democratic won for 2022 and 2023 maps.
We added the calculation as orange and green line in our graphs.
un_runs.py
, sb_runs.py
, gingleator.py
are modified from shortbursts-gingles
un_runs.py
is for doing unbiased runs on minority population and it'll generate corresponding pickle files for further analysissb_runs.py
is for doing short burst runs on minority population and it'll generate corresponding numpy files and pickle files for further analysisgingleator.py
is an utility class and methods defined in it are used inun_runs.py
andsb_runs.py
NC_results.ipynb
This notebook contains graphs we generated based on the pickle files and numpy files generated by doing unbiased and short burst runs
/figures/outlier analysis-histogram (2022 seed)
folder contains all the extra graphs we created but didn't do detailed analysis on
Raw data are too large to be pushed onto the Github, they can be downloaded through this Google Drive Link