This project gives several interactive visualizations of 311 service requests for graffitti removal in the city of chicago. They may be viewed at the following link.
- postgreSQL
- Python
- SQLAlchemy
- pandas
- Jupyter Lab
- csv
- pandas
- json
- JavaScript
- D3
- Plotly.js
- Leaflet.js
- HTML
- CSS
- Export data to
311_Service_Requests_-_Graffiti_Removal_-_No_Duplicates.csvfrom the Chicago data portal - Run python script
data_munge.pyto extract relevant data. - Create a local database to store data for subsequent analysis.
createdb graffiti
- Use postgreSQL to run the
schema.sqlfile to create theGraffitiDatatable
psql -d graffiti -f schema.sql
- Use postgreSQL to load the cleaned csv into the newly created table.
psql -d graffiti -c "COPY GraffitiData(creation_date,status,completion_date,type_of_service_request,surface_type,graffiti_location,zip,ward,community_area,latitude,longitude) FROM 'path_to_file/gra_req_clean.csv' WITH DELIMITER ',' CSV;"
-
Create a file
databaseconfigto hold credentials for the database. -
Use the
do_querries.ipynbjupyter notebook to create the json files used by the plots.
Demographic data from Chicago data portal
2010 Census data from CMAP Data Hub