Analyzing large election data set with Python
The purpose of the election audit of a recent local Colorado Congressional Election was to asses the voter turnout for each county, the percentage of votes from each county out of the total count, and the county with the highest turnout. Canidiate results were also assessed to drill down the vote count and precentage of votes cast for each candidate.
-
How many votes were cast in this congressional election?
- There were 369,711 total votes cast.
-
Provide a breakdown of the number of votes and the percentage of total votes for each county in the precinct.
- Jefferson county cast 10.5% of the vote and 38,855 number of votes.
- Denver county cast 82.8% of the vote and 306,055 number of votes.
- Arapahoe county cast 6.7% of the vote and 24,801 number of votes.
-
Which county had the largest number of votes?
- Largaret County Turnout: Denver
- Largest County Vote Count: 306,055
-
Provide a breakdown of the number of votes and the percentage of the total votes each candidate received.
- Charles Casper Stockham received 23.0% of the vote and 85,213 number of total votes.
- Diana DeGette received 73.8% of the vote and 272,892 number of total votes.
- Raymon Anthony Doane received 3.1% of the vote and 11,606 number of total votes.
-
Which candidate won the election, what was their vote count, and what was their percentage of the total votes?
- Winner: Diana DeGette
- Winning Vote Count: 272,892
- Winning Percentage: 73.8%
'Election Results text file' election_results.txt
The following election analysis script can be used, with modifications, to audit which counties the candidates received the most votes from, the date with the largest voter turnout, and the precentage of the largest county votes vs. the winning vote count precentage. The value to drill down the data to specific metric could aid the Colorado Board of Elections poll center placement, advertising efforts in low turnout counties, and tracking trends from each election cycle.
'PyPoll_Challenge Python Script' PyPoll_Challenge.py