Exploration and visualization of arrests/crime in New York City.
Find the Tableau Dashboard here.
New York City arrest data from NYC OpenData was ingested via the Socrata Open Data API (SODA) in Python. The data was then processed using Pandas/NumPy to allow for easier analysis in Tableau. Using spatial files (.shp), GeoPandas was used to map each arrest to a neighborhood name based on its latitude and longitude (i.e. reverse geocoding).
To get information regarding police precincts, data was scraped using BeautifulSoup from the NYC Gov. site.
See code in Jupyter Notebooks for full details.
Data File | Name | Category | Socrata domain | Socrata dataset identifier | Data range | Update frequency |
---|---|---|---|---|---|---|
1D | NYPD Arrest Data (Year to Date) | Public Safety | data.cityofnewyork.us | uip8-fykc | Year to date | Quarterly |
2D | NYPD Arrest Data (Historic) | Public Safety | data.cityofnewyork.us | 8h9b-rp9u | 2006 to end of previous calendar year | Annually |
Spatial File | Name |
---|---|
1S | Neighborhood Tablulation Areas (NTA) |
2S | Police Precincts |
Other | Name |
---|---|
O1 | NYPD Precincts |
For this project, data was pulled from the start of 2018 to the end of the previous quarter of the current calendar year.
Note: Data is available from 2006 onwards. Last quarter's data may not be completely accurate due to lag from NYPD to the NYC OpenData database.
- Socrata Open Data API
- Socrata Dev
- NYC OpenData
- Time Series Analysis
- Python Packages: Pandas, NumPy, GeoPandas
- Add crime rate toggle to map (i.e. number of crimes/population)
- Visualizations for YoY and MoM changes