Giter VIP home page Giter VIP logo

election-analysis's Introduction

Election-Analysis

Project Overview

Tom and Seth have a data set holding the result of a vote. We need to analyze the data to find out the election result. To break down, we need total vote cast; vote cast of each county; Candidates' result; who is the winner.

Election-Audit Results

  • Total Votes: 369,711

  • County Votes:

    • Jefferson : 38,855 (10.51%)
    • Denver : 306,055 (82.78%)
    • Arapahoe : 24,801 (6.71%)
  • Largest County Turnout:

    • Denver (306,055)
  • Candidate Result:

    • Charles Casper Stockham: 23.0% (85,213)
    • Diana DeGette: 73.8% (272,892)
    • Raymon Anthony Doane: 3.1% (11,606)
  • Winning Detail:

    • Winner: Diana DeGette
    • Winning Vote Count: 272,892
    • Winning Percentage: 73.8%

image

Election-Audit Summary:

In this Challenge, Python os and csv modules are imported. If another similar analysis will be performed, the data should be save into the Resources file, and the Path in the code should be modified.

Refactoring for Condition I

For any election data, having the second column as Region name, and the third column as the candidates' name, we can run this code. Just replace 'County' with other region unit. (like Community, Class, Cities, etc.)

Refactoring for Condition II

If there's no county/region information, this code could also reusable. From line94 to line121, all the County analysis should be removed. As well as line 89 (f"County Votes:\n") should be removed as well.

image

election-analysis's People

Contributors

hjx2019 avatar

Watchers

 avatar

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.