Analyzing election information in Python
##Project Overview An employee from the Colorado Election Commission asked for help in analyzing the results of a congressional race.
- Calculated the total number of votes cast for all candidates.
- Created a complete list of candidates who received votes.
- Calculated the percentage of votes each candidate won.
- Calculated the total number of votes each candidate won.
- Calculated the winner of the election based on popular vote and percentage of votes won.
- Printed each candidate's name, the total number of votes won and the percentage of votes won.
- Printed a summary for the winner of the election to include the winning candidate's name, total votes won and percentage of votes won.
- Data Source: election_results.csv
- Software: Python 3.8.1, Visual Studio Code, 1.41.1
The analysis of the election show:
-
Total votes cast in the election were 369711
-
The candidates were:
- Charles Casper Stockham
- Diana DeGette
- Raymon Anthony Doane
-
The candidate results were:
- Charles Casper Stockham received 23.0% of the votes and 85,213 total votes.
- Diana DeGette received 73.8% of the votes and 272,892 total votes.
- Raymon Anthony Doane received 3.1% of the votes and 11,606 total votes.
-
The winner of the election was:
- Diana DeGette with 73.8% of the votes and 272,892 total votes.
The Colorado Election Commission wants to confirm the voter turnout for each county that participated in this election.
- Calculated the total number of votes in all counties.
- Created a complete list of counties that cast votes.
- Calculated the percentage of votes for each county.
- Calculated the total number of votes cast in each county.
- Calculated the county with the largest number of votes cast.
- Printed each county's name, total number of votes cast, and percentage of the total votes cast.
- Printed the county's name with the largest number of votes and that total number of votes cast.
- Data Source: election_results.csv
- Software: Python 3.8.1, Visual Studio Code, 1.41.1
The analysis of the election show:
- Total votes cast in the election were 369711
- The counties were:
- Arapahoe
- Denver
- Jefferson
- The county results were:
- Arapahoe received 6.7% of the votes and 24,801 total votes.
- Denver received 82.8%% of the votes and 306,055 total votes.
- Jefferson received 10.5% of the votes and 38,855 total votes.
- The county with the largest number of votes cast was:
- Denver