Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -48,7 +48,7 @@ def load_data():
|
|
| 48 |
st.error(f"Error loading data: {e}")
|
| 49 |
return None
|
| 50 |
|
| 51 |
-
#
|
| 52 |
def create_dashboard(data):
|
| 53 |
"""Create dashboard visualizations"""
|
| 54 |
st.header("Business Insights Dashboard")
|
|
@@ -71,7 +71,8 @@ def create_dashboard(data):
|
|
| 71 |
with col2:
|
| 72 |
# Event Types Distribution
|
| 73 |
event_counts = data['events']['Event'].value_counts().reset_index()
|
| 74 |
-
|
|
|
|
| 75 |
title='Event Type Distribution')
|
| 76 |
st.plotly_chart(fig, use_container_width=True)
|
| 77 |
|
|
|
|
| 48 |
st.error(f"Error loading data: {e}")
|
| 49 |
return None
|
| 50 |
|
| 51 |
+
#Dashboard
|
| 52 |
def create_dashboard(data):
|
| 53 |
"""Create dashboard visualizations"""
|
| 54 |
st.header("Business Insights Dashboard")
|
|
|
|
| 71 |
with col2:
|
| 72 |
# Event Types Distribution
|
| 73 |
event_counts = data['events']['Event'].value_counts().reset_index()
|
| 74 |
+
event_counts.columns = ['Event', 'Count'] # Rename columns explicitly
|
| 75 |
+
fig = px.pie(event_counts, names='Event', values='Count',
|
| 76 |
title='Event Type Distribution')
|
| 77 |
st.plotly_chart(fig, use_container_width=True)
|
| 78 |
|