In this project, Python was used to analyze the election results and calculate county-by-county data in a recent Colorado election.
-
There were 369,711 votes cast in the election, as shown in the below screenshot of the vote total from the analysis.
-
Jefferson County contributed 38,855 votes (10.5% of the total), Denver County contributed 306,055 votes (82.8% of the total), and Arapahoe County contributed 24,801 votes (6.7% of the total), as shown in the below screenshot of the analysis.
-
Denver County had the largest number of votes.
-
Charles Casper Stockham received 85,213 votes (23.0% of the total), Diana DeGette received 272,892 votes (73.8% of the total), and Raymon Anthony Doane received 11,606 votes (3.1% of the total), as shown in the below screenshot from the analysis.
-
Diana DeGette won the election with 272,892 votes (73.8% of the total).
The script written for this analysis can be used for any election. The .csv file containing the election data would have to be changed to one corresponding to a different election, of course, in order to analyze a different election. As long as the file is in the same format it should work fine though. And if you want to use this script in something other than a state election, the script could be modified to output data for neighborhoods instead of counties (for a county election) or states instead of counties (for a federal election).