election icon

Election Python Library

From the CORGIS Dataset Project

By Ryan Whitcomb
Version 2.0.0, created 6/1/2016
Tags: politics, election, votes, counties, candidate

Overview

Data about the results was collected from CNN’s 2016 election center. Each county has the breakdown of how many votes each candidate recieved in that county and what percentage of the total vote from that county that the candidate recieved. The candidate’s political party is also represented.

http://www.cnn.com/election/primaries/counties/va/Dem

Explore Structure

Each row represents $MISSING_FIELD.

Index Type Example Value
0 dict { }
1 dict (same structure)
2 dict (same structure)
... ... ...
Key Type Example Value Description
"Location" dict { }
"Vote Data" dict { }
Key Type Example Value Description
"County" str "Abbeville" $MISSING_FIELD
"State" str "South Carolina" $MISSING_FIELD
"State Abbreviation" str "SC" $MISSING_FIELD
Key Type Example Value Description
"Ben Carson" dict { }
"Bernie Sanders" dict { }
"Carly Fiorina" dict { }
"Chris Christie" dict { }
"Donald Trump" dict { }
"Hillary Clinton" dict { }
"Jeb Bush" dict { }
"John Kasich" dict { }
"Marco Rubio" dict { }
"Martin O'Malley" dict { }
"Mike Huckabee" dict { }
"No Preference" dict { }
"Rand Paul" dict { }
"Rick Santorum" dict { }
"Ted Cruz" dict { }
"Uncommitted" dict { }
Key Type Example Value Description
"Number of Votes" int 305 $MISSING_FIELD
"Party" str "Republican" $MISSING_FIELD
"Percent of Votes" float 8.3 $MISSING_FIELD
Key Type Example Value Description
"Number of Votes" int 312 $MISSING_FIELD
"Party" str "Democrat" $MISSING_FIELD
"Percent of Votes" float 17.0 $MISSING_FIELD
Key Type Example Value Description
"Number of Votes" int 0 $MISSING_FIELD
"Party" str "Republican" $MISSING_FIELD
"Percent of Votes" float 0.0 $MISSING_FIELD
Key Type Example Value Description
"Number of Votes" int 0 $MISSING_FIELD
"Party" str "Republican" $MISSING_FIELD
"Percent of Votes" float 0.0 $MISSING_FIELD
Key Type Example Value Description
"Number of Votes" int 1353 $MISSING_FIELD
"Party" str "Republican" $MISSING_FIELD
"Percent of Votes" float 36.9 $MISSING_FIELD
Key Type Example Value Description
"Number of Votes" int 1501 $MISSING_FIELD
"Party" str "Democrat" $MISSING_FIELD
"Percent of Votes" float 81.8 $MISSING_FIELD
Key Type Example Value Description
"Number of Votes" int 236 $MISSING_FIELD
"Party" str "Republican" $MISSING_FIELD
"Percent of Votes" float 6.4 $MISSING_FIELD
Key Type Example Value Description
"Number of Votes" int 157 $MISSING_FIELD
"Party" str "Republican" $MISSING_FIELD
"Percent of Votes" float 4.3 $MISSING_FIELD
Key Type Example Value Description
"Number of Votes" int 740 $MISSING_FIELD
"Party" str "Republican" $MISSING_FIELD
"Percent of Votes" float 20.200000000000003 $MISSING_FIELD
Key Type Example Value Description
"Number of Votes" int 0 $MISSING_FIELD
"Party" str "Democrat" $MISSING_FIELD
"Percent of Votes" float 0.0 $MISSING_FIELD
Key Type Example Value Description
"Number of Votes" int 0 $MISSING_FIELD
"Party" str "Republican" $MISSING_FIELD
"Percent of Votes" float 0.0 $MISSING_FIELD
Key Type Example Value Description
"Number of Votes" int 0 $MISSING_FIELD
"Party" str "N/A" $MISSING_FIELD
"Percent of Votes" float 0.0 $MISSING_FIELD
Key Type Example Value Description
"Number of Votes" int 0 $MISSING_FIELD
"Party" str "Republican" $MISSING_FIELD
"Percent of Votes" float 0.0 $MISSING_FIELD
Key Type Example Value Description
"Number of Votes" int 0 $MISSING_FIELD
"Party" str "Republican" $MISSING_FIELD
"Percent of Votes" float 0.0 $MISSING_FIELD
Key Type Example Value Description
"Number of Votes" int 876 $MISSING_FIELD
"Party" str "Republican" $MISSING_FIELD
"Percent of Votes" float 23.9 $MISSING_FIELD
Key Type Example Value Description
"Number of Votes" int 0 $MISSING_FIELD
"Party" str "N/A" $MISSING_FIELD
"Percent of Votes" float 0.0 $MISSING_FIELD

Downloads

Download all of the following files.

  1. election.py
  2. election.data

Usage

import election
result = election.get_result()

Documentation

get_result()
Returns a list of dictionaries representing result.