/Election_Analysis

Python code

Primary LanguagePython

Election_Analysis

Overview of Election Audit

The purpose of this project is to understand Python by using different data types, conditional statments and logical operators in VS code text editor. In this challenge, using mathematical operations to determine election results from county congressional election. The following analysis include:

  1. Calculate the total number of votes
  2. Get a list of county votes and the percetage of votes for each county
  3. Determine the county that received the largest vote counts
  4. Get a total number of votes each candidate received in the election
  5. Evaluate the percentage of votes each candidate received
  6. Determine the winning candidate based on the numbers of votes received

Election-Audit Results

Below screenshot is the output in the Terminal command line of my analysis.

Terminal Output

According to Election results, the total number of votes in the congressional election was 369,711 votes. Denver become the county that received the highest number of votes which was 82.8% (306,055) out of total number of votes. Jefferson was the second highest county with 10.5% (38,855) votes out of total votes followed by the Arapahoe with 6.7% (24,801) votes.

As for candidate in the election, Diana DeGette received the most popular votes and won the election with the winning percentage 73.8% and 272,892 winning votes against the other candidates. Charles Casper Stockham received 23.0% (85,213) votes out of total number of votes followed by Raymon Anthony Doane with 3.1% (11,606) votes in the election.

Election-Audit Summary

  • The script can be modified to evaluate total number of vote casts with differnt filtered categories more than candidate or county. If the data included other categories such as geographical locations or the cities are given in the current datasets, the current script can be modified further more to determine the total vote counts on those new characteristics datasets. Another modification can be improved to calculate the percentage of vote that each candidate received popular votes based on geographical locations.