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




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

Downloads

Download all of the following files.

Usage

This library has 1 function you can use.
import election
list_of_result = election.get_results()
Additionally, some of the functions can return a sample of the Big Data using an extra argument. If you use this sampled Big Data, it may be much faster. When you are sure your code is correct, you can remove the argument to use the full dataset.
import election
# These may be slow!
list_of_result = election.get_results(test=True)

Documentation

 election.get_results(test=False)

Returns the result of each primary for every county from the dataset.