The Election analysis is done with Python programming using Visual Studio Code. The data used is of Colorado Local congressional Election.
In this project I am helping Tom - Colorado Board of Election employee to complete the election audit of a recent local congressional election. Alongwith Tom My task here will be to report :
- Total # of Votes Cast
- Get the list of candidates who received votes.
- Total # of votes for each candidate
- % of Votes for each candidate and
- Finally the Winner of the election based on popular vote.
Further while working on challenge few more tasks were added by election commission :
- 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 # of Votes counted were 369,711. Screenshot for the same as follows:
- Now, we started with getting the list of candidates and calculating the total # & % of votes each candidate received. Its better explained with the below code and its reading:
- Further we started working on coding for Winning candidate with its votes and % of votes the candidate won by :
So until here i tried to help Tom & Seth to submit the the election audit results to the election commission. But wait! The election commission has requested some additional data to complete the audit:
- The voter turnout for each county
- The percentage of votes from each county out of the total count
- The county with the highest turnout.
All the above can be better understood by the below code and its outcome in txt file.
To summarize - myself with Tom & Seth we'll worked on Colorado Local congressional election to submit the election audit results to election commission. The outcome summary of the Colorado Local congressional election analysis is as follows :
This script can be easily modified to fit any type of election. For example, if you wanted to analyze a federal congressional election, all you need to do is change the counties to states. Another example, if you had a local initiative election, all you need to do is change candidates to in favor or against.
- Data: election_results.csv
- Software: Python 3.7.6, Visual Studio Code 1.62.0