Download Our Election Data

In order to facilitate broader discussion of the election, we have written a set of python scripts to download and organize data relating to the election. There is still a fairly high barrier to obtaining election results, so we wanted to make a clean source available for those interested. In addition to the series discussed in our previous post (here), we have included data on voting machines for those who wish to explore questions related to the recount.The code will download election results, graph them, and merge them into a .csv for statistical analysis.

We have made them available through the following sources:

  1. github: here
  2. dropbox: here

To run it, install Python (we suggest Anaconda), open a terminal and run the “Main.py” program from the file in which it was downloaded after editing options. It is likely that with a fresh installation of Python, additional modules will be necessary. This can be done by opening a terminal and typing “pip install <module name>” without quotes, and the required module substituted for <module name>.

Series available (County-level):

  1. 2016 Election (President, House, Senate, Governor)
  2. 2012 Election (President, House, Senate, Governor)
  3. 2008 Election (President, House, Senate, Governor)
  4. 2004 Election (President, House, Senate, Governor)
  5. Economic Statistics (unemployment, income, establishments, industries)
  6. Demographics (race, age, gender, education)

Series provided but not merged (County-level):

  1. 2002 industry composition
  2. Voting Rights Act coverage
  3. Voting machine type (paper, electronic, etc.)

The available options are explained and edited in the “Main.py” file. We will be gradually updating our code to include options for more series, as well as merging the “extra” series currently not merged.

Any coding contributions or comments are much appreciated.

Leave a Reply

Your email address will not be published. Required fields are marked *