Skip to content

titogithub123/PyPoll-with-Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyPoll-with-Python

Analyzing Election Results in the State of Colorado.

Overview of Election Audit

The purpose of the analysis was to determine the results of a recent election in three specific counties in the State of Colorado. We were able to implement our new found skills using the python programming language to run calculations and iterate over our raw data to determine a few of the following metrics.

- The voter turnout for each county.
- The percentage of votes from each county out of the total count.
- The county with the highest turnout.

In addition, thanks to the work that we have completed we were also able to determine the ultimate winner of the election, taking into account the winning vote count and also the winning percentage.

Election Audit Results

  1. One of the very first calculations we wanted to determine was the number of total votes cast in the election. Based on this information we would then be able to dive deeper into the data to determine the rest of the metrics we wanted to answer. In order to make our work as efficient as possible we used a 'For' loop to iterate over the data and add together all the ballots cast.

image

Here we can see how we used our code to loop over the data to retrieve the total vote count.

  1. Secondly, we wanted to have a good understanding of how the votes were broken down by each county, specifically and ultimately, we wanted to determine which county recived the highest number of votes. In order to do that we had to collect the total vote count and subdivide it by county. In the code below we can see how we used our python skills to determine how the votes broke down per county.

image

  1. By determining the total vote count per county we were able to easily extract which county received the highest number of votes. As we could imagine, it was no surprise to see that the county of Denver was the county that recieved the highest number of votes.

image

As it turns out the percentages of votes cast per county was not even very close with 'Denver' taking approx. 83% of the total votes cast.

  1. We also wanted to see if we could determine the amount of votes each candidate received and calculate the percentage of the whole of votes cast for the main contenders in the election. To do this we used code that was very similar to the code we used to determine the county breakdown results. As such, we see that candidate Diana DeGette received a total of 272,892 votes, which calculates to a little more than 73% of the total votes cast.

image

  1. Once armed with the information above it was easy to see that Diana DeGette was the clear winner of this year's political election for the three counties that participated in the voting.

Election Audit Summary

It is our humble opinion that the script that we used to determine the county breakdown of votes, the percentage of votes cast per candidate and ultimately, determine the winner of the election by total votes and winning percentage of total votes cast, can be used in a wider range of political elections throughout the country. By making small modifications to the script, it can easily be adapted for greater use.

The two modifications we would recommend would be...

1. Updating the counties to be considered in the election results, and..
2. Updating the candidates in the election for the given counties. 

It is our sincere wish that this information proves useful not only for the election we performed the actual analysis on but also, for further elections throughout the country.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages