Election-Analysis

Project Overview

A Colorado Board of Elections employee has given you the following tasks to complete the election audit of a recent local congressional election.

  1. Calculate the total number of votes cast
  2. Get a complete list of candidates who received votes
  3. Calculate the total number of votes each candidate received
  4. Calculate the percentage of votes each candidate won
  5. Determine the winner of the election based on popular vote

Resources

  • Data Source: election_results.csv
  • Software: Python 3.7.6, Visual Studio Code 1.63.2

Results

The analysis of the election show that:

  • There were 369,711 votes cast in the election.

  • Counties taken into account for this analysis were:

    • Jefferson
    • Denver
    • Arapahoe
  • The turnout by county was:

    • Jefferson totaled 10.5% of the votes with 38,855 votes
    • Denver totaled 82.8% of the votes with 306,055 votes
    • Arapahoe totaled 6.7% of the votes with 24,801 votes
  • The largest turnout was:

    • Denver with 82.8% of the total with 306,055 votes
  • The candidates were:

    • Charles Casper Stockham
    • Diana DeGette
    • Raymon Anthony Doane
  • The candidate results were:

    • Charles Casper Stockham received 23% of the vote and 85,213 number of votes
    • Diana DeGette received 73.8% of the vote and 272,892 number of votes
    • Raymon Anthony Doane received 3.1% of the vote and 11,606 number of votes
  • The winner of the election was:

    • Diana DeGette, who received 73.8% of the vote and 272,892 number of votes

Summary

This script is dynamic enough to add modifications for it to fit a great number of datasets. For example, a more robust dataset could be introduced and add a few more lines for it to analyze profoundly the data and get details that in this simple-3-column one we couldn't find. Another suggestion would be to asign each state the value given by the US electoral college, but this one may only be to federal elections.

Overall, this is a simple but useful script to overview the specifics of poll-based databases it is a good base to start from to analyze a large amount of data.