Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -132,7 +132,7 @@ def create_map(df, selected_year):
|
|
132 |
def create_injuries_fatalities_chart(crash_data, unit_type):
|
133 |
|
134 |
# 5th visualization title
|
135 |
-
st.header("5. Total Injuries and Fatalities by Month")
|
136 |
|
137 |
# Filter rows where we have valid data for all necessary columns
|
138 |
crash_data = crash_data[['DateTime', 'Totalinjuries', 'Totalfatalities', 'Unittype_One', 'Unittype_Two']].dropna()
|
@@ -452,6 +452,7 @@ def main():
|
|
452 |
st.markdown("""
|
453 |
## **Crash Trend Over Time**
|
454 |
This interactive line chart visualizes the trend of unique traffic crashes over the years, optionally filtered by weather conditions. It highlights how crash frequency changes over time, helping identify trends and potential contributing factors.
|
|
|
455 |
**Key Features:**
|
456 |
* **Time Trend Analysis**: Displays the total number of unique crashes for each year, showing long-term patterns.
|
457 |
* **Weather Filter**: Users can filter the data by weather conditions (e.g., "Rainy", "Sunny") to analyze how weather impacts crash trends.
|
@@ -567,7 +568,7 @@ def main():
|
|
567 |
## Distribution of Incidents by {selected_category}
|
568 |
This visualization explores the distribution of traffic incidents across various categories, such as Collision Manner, Weather, Surface Condition, Alcohol Use, and Driver Gender. Each bar represents a specific category value (e.g., "Male" or "Female" for Gender), and the bars are divided into segments based on Injury Severity (e.g., Minor, Moderate, Serious, Fatal).
|
569 |
|
570 |
-
**Key
|
571 |
* Interactive Filters: Select a category and filter by year to analyze trends over time.
|
572 |
* Insightful Tooltips: Hover over each segment to view the exact count and percentage of incidents for a given severity level.
|
573 |
* Comparative Analysis: Quickly identify how different conditions or behaviors correlate with injury severity.
|
|
|
132 |
def create_injuries_fatalities_chart(crash_data, unit_type):
|
133 |
|
134 |
# 5th visualization title
|
135 |
+
# st.header("5. Total Injuries and Fatalities by Month")
|
136 |
|
137 |
# Filter rows where we have valid data for all necessary columns
|
138 |
crash_data = crash_data[['DateTime', 'Totalinjuries', 'Totalfatalities', 'Unittype_One', 'Unittype_Two']].dropna()
|
|
|
452 |
st.markdown("""
|
453 |
## **Crash Trend Over Time**
|
454 |
This interactive line chart visualizes the trend of unique traffic crashes over the years, optionally filtered by weather conditions. It highlights how crash frequency changes over time, helping identify trends and potential contributing factors.
|
455 |
+
|
456 |
**Key Features:**
|
457 |
* **Time Trend Analysis**: Displays the total number of unique crashes for each year, showing long-term patterns.
|
458 |
* **Weather Filter**: Users can filter the data by weather conditions (e.g., "Rainy", "Sunny") to analyze how weather impacts crash trends.
|
|
|
568 |
## Distribution of Incidents by {selected_category}
|
569 |
This visualization explores the distribution of traffic incidents across various categories, such as Collision Manner, Weather, Surface Condition, Alcohol Use, and Driver Gender. Each bar represents a specific category value (e.g., "Male" or "Female" for Gender), and the bars are divided into segments based on Injury Severity (e.g., Minor, Moderate, Serious, Fatal).
|
570 |
|
571 |
+
**Key Features:**
|
572 |
* Interactive Filters: Select a category and filter by year to analyze trends over time.
|
573 |
* Insightful Tooltips: Hover over each segment to view the exact count and percentage of incidents for a given severity level.
|
574 |
* Comparative Analysis: Quickly identify how different conditions or behaviors correlate with injury severity.
|