GithubHelp home page GithubHelp logo

tioans / us-elections-20 Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.74 MB

Repository for the Udacity Data Scientist Nanodegree, project 1. An analysis of the 2020 US Presidential election.

Jupyter Notebook 100.00%

us-elections-20's Introduction

us-elections-20

An analysis of the 2020 US Presidential election. Medium article.

About

The 59th quadrennial US presidential election was held on Tuesday, November 3, 2020. To win the election, the candidate needs as a minimum 270 out of 538 electoral votes.

This project hopes to better explain the election results by use of official data, and aims to illustrate the answer to three questions, as defined below:

  1. Which state had the absolute highest number of votes placed in the presidential election?
  2. Which states were won by which candidate in the presidential election?
  3. What is the distribution of non-major party votes per state for the presidential election?

The dataset was obtained from Kaggle: https://www.kaggle.com/unanimad/us-election-2020

Libraries

For this project, Numpy, Pandas and Plotly were used. Furthermore, it was developed as a Google Colab notebook.

File breakdown

  • us_elections_20.ipynb Jupyter Notebook with the analysis and code.
  • archive.zip The election dataset collected from Kaggle. Furthermore, an additional dataset with US state names and initials was added to the archive (also collected from Kaggle).

Summary

  1. Based on the data, California is the state with the highest amount of votes by a comfortable 6 million lead.
  2. The generated interactive map illustrates which states were won by which candidate; states with the color blue (all shades) were won by the Democratic Party candidate. States with the color red (all shades) were won by the Republican Party candidate. The darker the shade the bigger the lead for the corresponding party.
  3. Although there are a number of non-major parties involved in the presidential election, the highest voted "third-party" in every state is the Libertarian Party, with the most votes taken in South Dakota (11095, 2.625 %), followed by North Dakota and Utah.

Acknowledgments

Thanks to Raphael Fontes for gathering and publishsing the dataset to Kaggle. In addition, I'd like to thank Ashish Gupta for inspiring the visualization approach (link).

us-elections-20's People

Contributors

tioans 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.