Al-Huneidi / Election_Analysis

Analyzing election information in Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Election_Analysis

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.

  1. Calculated the total number of votes cast for all candidates.
  2. Created a complete list of candidates who received votes.
  3. Calculated the percentage of votes each candidate won.
  4. Calculated the total number of votes each candidate won.
  5. Calculated the winner of the election based on popular vote and percentage of votes won.
  6. Printed each candidate's name, the total number of votes won and the percentage of votes won.
  7. Printed a summary for the winner of the election to include the winning candidate's name, total votes won and percentage of votes won.

Resources

  • Data Source: election_results.csv
  • Software: Python 3.8.1, Visual Studio Code, 1.41.1

Summary

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.

    Challenge Overview

    The Colorado Election Commission wants to confirm the voter turnout for each county that participated in this election.

    1. Calculated the total number of votes in all counties.
    2. Created a complete list of counties that cast votes.
    3. Calculated the percentage of votes for each county.
    4. Calculated the total number of votes cast in each county.
    5. Calculated the county with the largest number of votes cast.
    6. Printed each county's name, total number of votes cast, and percentage of the total votes cast.
    7. Printed the county's name with the largest number of votes and that total number of votes cast.

    Resources

    • Data Source: election_results.csv
    • Software: Python 3.8.1, Visual Studio Code, 1.41.1

    Summary

    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

About

Analyzing election information in Python


Languages

Language:Python 100.0%