Code Monkey home page Code Monkey logo

analysispoliceshootings's Introduction

AnalysisPoliceShootings

Analysis of The Washington Post's Fatal Police Shootings database

The original data is published under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License and that license is included here as well.

The Washington Post has been collecting data about fatal police shootings since 2015 until present. The data is hosted here on Github and is regularly updated. The purpose of this project is to explore that data and create interactive visualizations for anyone to use and interpret.

This project is split into 3 notebooks:

  1. DataPreparation.ipynb: Load the dataset, take a initial look at the columns, print out basic info. Geocode cities/states into latitude/longitude coordinates. Create new columns that will make plotting easier.
  2. FindIncorrectCoord.ipynb: Visualize geocoding errors.
  3. PoliceShootingsAnalysis.ipynb: Main notebook that creates several visualizations of the data using plotly

There is also a utils.py file that contains code that geocodes cities, adds missing coordinates, fixes incorrect coordinates, and serializes data. In addition to this all the plots (except the map plots) are downloaded as png files and stored in the plots folder.

Viewing Notebooks

Plotly plots don't render correctly when viewed in Github, so the best way to view the notebooks that use plotly is to view them on nbviewer.jupyter.org. Below are links to view the notebooks on that website. Also the geographic map in PoliceShootingsAnalysis.ipynb has a small bug where if you press the button that says "years," the plot becomes emtpy. Just click and move the slider to fix this and the data points will appear. The same may happen when pressing the "states" button, just click on one of the state names on the right and the points should appear.

PoliceShootingsAnalysis.ipynb: http://nbviewer.jupyter.org/github/enerrio/AnalysisPoliceShootings/blob/master/PoliceShootingsAnalysis.ipynb FindIncorrectCoord.ipynb: http://nbviewer.jupyter.org/github/enerrio/AnalysisPoliceShootings/blob/master/FindIncorrectCoord.ipynb

Dependencies

  • numpy: 1.14.2
  • pandas: 0.20.3
  • plotly: 3.0.0
  • notebook: 5.5.0

analysispoliceshootings's People

Stargazers

Aaron Marquez avatar

Watchers

James Cloos avatar Aaron Marquez 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.