Giter Site home page Giter Site logo

election-analysis's Introduction

Election Analysis

Overview of Election Audit:

The Colorado Board of Elections requested help in completing an election audit of a recent local congressional election.

Purpose

This election analysis audit calculates the total number of votes cast in the congressional election. The task also required a complete list of candidates who received votes. Calculate the total number of votes received by candidates. The percentage of votes each candidate won. And, Determining the winning candidate for the election based on popular vote. This analysis used python to calculate the result in the provided CSV data.

Resources

Data Source: election_results.csv

Software: Python 3.8.3, Visual Studio Code 1.46.0

Election-Audit Results

The election analysis show that:

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

  • The candidates were:

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

    • Charles Casper Stockham received 23.0% 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 272,892 number of votes, 73.8% of the total votes cast in the election.

    Election_Results

Election-Audit Summary:

The script used to gather all the data points for this analysis was written in python using VSC. The method employed for this analysis should be considered by The Election Commission Board as a standard practice moving forward. The written code is highly versatile and efficient (less than) 200 lines of code enable the following functions:

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.
6. Calculate the voter turnout for each county.
7. Calculate the percentage of votes each county contributed to the election.
8. Determine which county had the largest turnout.

The python code is versatile in nature. The script assigns values structure to the given data. So, new data can be input into the code. The python code is also efficient because the code doesn't have to be modified heavily to calculate results from a new dataset. The efficiencies of the code are inherent because the actual structure of the code mimics the human language. The code requires fewer lines to execute a function.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.