A Colorado Board of Elections employee has asked for a report to determine the winning candidate of a recent local congressional election. They were looking for the following information:
- The total number of votes cast
- A complete list of candidates who received votes
- The total number of votes each candidate received
- The percentage of votes for each canditate won
- The winner of the election based on popular vote
- Data Source: election_results.csv
- Software: Python, Visual Studio
The analysis of the election showed the following:
Total votes cast in the election were 369,711.
Candidate Results:
- Charles Casper Stockham: 23.0% (85,213 votes)
- Diana DeGette: 73.8% (272,892)
- Raymon Anthony Doane: 3.1% (11,606)
The Colorado Board of Elections has requested additional detail on the election results. They would like to know:
- The voter turnout in each county
- The percentage votes of each county
- The written analysis of the election audit.
- Data Source: election_results.csv
- Software: Python, Visual Studio
- Starter Code = PyPoll_starter_challenge_code.py
The election audit results for the county votes are:
County Results:
- Jefferson: 38,855 (10.5% of total vote)
- Denver: 306,055 (82.8% of total vote)
- Arapahoe: 24, 801 (6.7% of total vote)
The county with the largest voter turnout was Denver with 306,055 votes cast, representing 82.8% of the total vote in the election.
This code can be used for future elections and to output results. Adjustments to the code could be made where necessary. In addition, we would need to change the reference to the source data and all pathways. For this project we used the file_to_load path to the election_results.CSV. That path would need to change depending on the name of the new csv file. We would also need to create a new output file that is unique to future projects so that we do not overwrite files from previous election results. This could be done by changing the file_to_save path to a new file name to receive the output.