☑️ Learning to use Python by analyzing election data. 🗳️
A Colorado Board of Elections employee has given you the following tasks to complete the election audit of a recent congressional election.
- Total number of votes cast.
- A complete list of candidates who received votes.
- Total number of votes each candidate received.
- Percentage of votes each candidate won.
- The winner of the election based on popular vote.
- Data Source: election_results
- Software: Python 3.7.6, Visual Studio Code, 1.53.2
The analysis of the election showed that:
- There were 369,711 total votes cast in the election.
- The candidates were:
- Charles Casper Stockham
- Diana DeGette
- Raymon Anthony Doane
- The results by candidate were:
- Charles Casper Stockham received 23.0% of the vote and 85,213 total votes.
- Diana DeGette received 73.8% of the vote and 272,892 total votes.
- Raymon Anthony Doane received 3.1% of the vote and 11,606 total votes
- The winner of the election was:
- Diana DeGette, who recieved 73.8% of the vote and 272,892 total votes.
The challenge asked for additional analysis related to the county voter turnout.
- The voter turnout for each county.
- The percentage of votes from each county out of the total count.
- The county with the highest turnout.
- The total number of votes cast in the congressional election is:
- The total number of votes by County are as follows:
- Denver County had the largest number of votes.
- The number of votes and the percentage of the total votes each candidate received are:
- Charles Casper Stockham received 23.0% of the vote and 85,213 total votes.
- Diana DeGette received 73.8% of the vote and 272,892 total votes.
- Raymon Anthony Doane received 3.1% of the vote and 11,606 total votes
- Here is an image of the code used to determine the vote percentage and the number of votes for each candidate.
- The Winner:
The summary of results may also be viewed with the election_analysis text document. The python code for the challenge can be found in PyPoll_Challenge.