Git Product home page Git Product logo

RItvik Dhupkar (Magician)'s Projects

2016-us-presidential-election-analysis icon 2016-us-presidential-election-analysis

Introduction This report contains the presentation and analysis on the 2016 Election Results. Part A contains a Presentation on the election results for all states, including which States were won by Republicans and which states were won by democrats. In this section we highlight the results of the patterns characterized in this years election. To do so we eliminate the focus of geographic space and imply the focus of voting results by eliminating the eyes draw to a natural USA map. In doing so we hope to look towards the voting results and not just the geography. Part B, attempts to present a county-wise result for the election.It also attempts to establish a relationship between the average percapita Income of a Region and the Propensity to vote for the republican candidate.The results from two states are analyzed in detail: Michigan and Pennsylvaina. These states were chosen because the Presidential race was quite close in both these states. A regression analysis of the vote share for Trump vs county Percapita income is conducted for counties in each of these states. Programming Methodology Followed Part A uses the 'Chorogrid' function to loop draw shape geometries for the states. It then loops through these various states and plots the results on a colormap. 1) The shapes are pre determined using the 'Chorogrid' module. They are essentially a blank slate that can be filled with data. 2) In doing so we can choose to manipulate the shapes on a whim by both sections using manually gathered election data from the ap poll website and the new york times website. 3) We chose to focus this attention by using the module as such: to change the way the output of the maps is determined. 4) So we then assign the data to the various shapes and output the maps. In Part B the following procedure is adopted: 1) County shape files are imported and read using the Cartopy shp reader. These geometries are plotted on the USA map using the add geometries command in cartopy 2) For assigning republican and democratic counties a for loop is used on the shapefile.attributes dictionary. The county geometries are assigned inside the loop and assigned the facecolor 'red ' for republican and 'blue' for democrat 3) Results are analyzed in detail for the state of Michigan. to plot the various counties of Michigan, a for loop is used on the shapefile.attributes dictionary. If the county is in Michigan, it is plotted. If it is republican , then it is plotted red, else it is plotted blue. The same procedure is adopted for plotting the ' Republican Voteshare' and the 'Per Capita Income' for the county 4) The same Procedure as in 3) is followed for the state of Pennsylvania 5) The seabon packeage and matplotlib packages are used to pot the regression of ' Trump Voteshare' 'Per Capita Income'. The data points are plotted ' red' and 'bllue' using matplotlib and the regression line and confidence interval is plotted using Seaborn

deeplearning.ai-summary icon deeplearning.ai-summary

This repository contains my personal notes and summaries on DeepLearning.ai specialization courses. I've enjoyed every little bit of the course hope you enjoy my notes too.

discrete_maths icon discrete_maths

this repo about my studying and training discrete math specialization on coursera. It covers many topics from logic to combinatorics and probablity

kaggle icon kaggle

My solution to Web Traffic Predictions competition on Kaggle.

lectures icon lectures

Lectures, notes, code, and other auxiliary materials

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.