This project uses jupyter notebook which you can view here.
The easiest way to run this is with docker installed and either yarn or npm (which are only used to make things easier to run). After cloning or downloading and navigating to this directory, this can be run in two ways:
To execute the notebook directly from the command line, run:
yarn nbrun
# or
npm run nbrun
# Or, the same command, directly with docker:
docker run -it --rm -v $PWD:/home/jovyan/work --rm jupyter/datascience-notebook jupyter nbconvert --execute work/app.ipynb
This will start a docker container, execute the notebook, create output.json
, and close the docker container.
Alternatively, to run the notebook server, i.e. to run the notebook interactively, run:
yarn jupyter # or npm run jupyter
and visit http://localhost:8888/notebooks/work/app.ipynb
in your browser.
Additionally, yarn nbconvert
can be used to convert the notebook to a normal .py
file for easy integration into existing python applications (as long as the requirements are met)
Election results data from here specifically here ( which seems identical to supplement.)
Census Data from here