Giter VIP home page Giter VIP logo

ec-apportionment's Introduction

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.

ec-apportionment's People

Contributors

dependabot[bot] avatar k-donn avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.