This repository contains code for a Streamlit application that serves as a dashboard for analyzing motor vehicle collisions in New York City.
To run the application locally, follow these steps:
-
Clone this repository to your local machine.
git clone https://github.com/Antisource/MVC.git
-
Install the required dependencies using pip:
pip install streamlit pandas numpy pydeck plotly
-
Navigate to the directory containing the code.
-
Run the Streamlit application:
streamlit run app.py
The data used in this application is sourced from the Motor Vehicle Collisions - Crashes dataset provided by the City of New York. The dataset is included in the repository as Motor_Vehicle_Collisions_-_Crashes.csv.
The dashboard provides the following functionality:
-
Where are the most people injured in NYC?
- Use the slider to select the number of persons injured in vehicle collisions.
- The map will display locations where the number of injured persons meets or exceeds the selected threshold.
-
How many collisions occur during a given time of day?
- Use the slider to select the hour of the day.
- Displays a heatmap of collisions occurring during the selected hour.
-
Breakdown by minute between selected hours
- Provides a breakdown of collisions by minute within the selected hour range.
-
Top 5 dangerous streets by affected type
- Select a type of affected people (Pedestrians, Cyclists, or Motorists) from the dropdown menu.
- Displays the top 5 dangerous streets based on the selected affected type.
-
Show Raw Data
- Checkbox option to display the raw data used for analysis.
- Data Source: NYC OpenData
- Built with Streamlit
- Visualization with Pydeck and Plotly Express