Skip to content

Latest commit

 

History

History
44 lines (28 loc) · 1.37 KB

README.md

File metadata and controls

44 lines (28 loc) · 1.37 KB

Electoral College Apportionment

A Matplotlib representation of CGP Grey's Electoral College spreadsheet. This animates the number of representatives, people to representative ratio, and priority number calculations.

See Running for instructions on how to get started

Usage

usage: python source/bar_chart.py [-h] -f FILE [-d]

Show an animation of the Huntington–Hill apportionment method

optional arguments:
  -h, --help            show this help message and exit
  -f FILE, --file FILE  Path to CSV state population data
  -d, --debug           Show the plot instead of writing to file

Example

Example GIF

Running

  • Create conda env from environment.yml (see Install Conda)
  • From the root of the folder,
python ./source/bar_chart.py -f ./data/state-populations.csv
  • The resulting video is put into ./recordings
  • If there are any errors, they are most likely backend related.

Meta

From this video.

Update/Change the state population data by putting your own data into state-populations.csv or pass the new name of the file from the command line.

The CSV file should not have a header.