Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -93,35 +93,37 @@ uploaded_file = "Intervention.csv"
|
|
| 93 |
df_full = pd.read_csv(uploaded_file) # Load the full data *once*
|
| 94 |
st.write("Overall Data Visualizations")
|
| 95 |
|
| 96 |
-
col1_full, col2_full = st.columns([0.9, 0.9])
|
| 97 |
|
| 98 |
-
with col1_full:
|
| 99 |
-
fig_gender_full = px.histogram(df_full, x="Gender", title="Overall Gender Distribution")
|
| 100 |
-
fig_gender_full.update_layout(height=350, width=350)
|
| 101 |
-
st.plotly_chart(fig_gender_full)
|
| 102 |
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
st.plotly_chart(fig_youth_full)
|
| 106 |
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
|
|
|
| 110 |
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
st.plotly_chart(fig_category_full)
|
| 115 |
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
|
|
|
| 123 |
|
| 124 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 125 |
df = pd.read_csv(uploaded_file)
|
| 126 |
st.subheader("Chat with AI")
|
| 127 |
st.write("Get visualizations and analysis from our Gemini powered agent")
|
|
|
|
| 93 |
df_full = pd.read_csv(uploaded_file) # Load the full data *once*
|
| 94 |
st.write("Overall Data Visualizations")
|
| 95 |
|
|
|
|
| 96 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
|
| 98 |
+
if tabs =='Chat':
|
| 99 |
+
col1_full, col2_full = st.columns([0.9, 0.9])
|
|
|
|
| 100 |
|
| 101 |
+
with col1_full:
|
| 102 |
+
fig_gender_full = px.histogram(df_full, x="Gender", title="Overall Gender Distribution")
|
| 103 |
+
fig_gender_full.update_layout(height=350, width=350)
|
| 104 |
+
st.plotly_chart(fig_gender_full)
|
| 105 |
|
| 106 |
+
fig_youth_full = px.histogram(df_full, x="Youth", title="Overall Youth Participation")
|
| 107 |
+
fig_youth_full.update_layout(height=350, width=300)
|
| 108 |
+
st.plotly_chart(fig_youth_full)
|
|
|
|
| 109 |
|
| 110 |
+
fig_company_full = px.histogram(df_full, y="Company Name", title="Overall Company Distribution")
|
| 111 |
+
fig_company_full.update_layout(height=300, width=300)
|
| 112 |
+
st.plotly_chart(fig_company_full)
|
| 113 |
|
| 114 |
+
with col2_full:
|
| 115 |
+
fig_category_full = px.histogram(df_full, y="Intervention_Category", title="Overall Intervention Category Distribution")
|
| 116 |
+
fig_category_full.update_layout(height=300, width=200)
|
| 117 |
+
st.plotly_chart(fig_category_full)
|
| 118 |
|
| 119 |
+
fig_intervention_full = px.histogram(df_full, y="Intervention", title="Overall Intervention Type Distribution")
|
| 120 |
+
fig_intervention_full.update_layout(height=300, width=300)
|
| 121 |
+
st.plotly_chart(fig_intervention_full)
|
| 122 |
+
|
| 123 |
+
fig_pie_category = px.pie(df_full, names='Intervention_Category', title='Overall Intervention Category Pie Chart')
|
| 124 |
+
fig_pie_category.update_layout(height=400, width=500)
|
| 125 |
+
st.plotly_chart(fig_pie_category)
|
| 126 |
+
|
| 127 |
df = pd.read_csv(uploaded_file)
|
| 128 |
st.subheader("Chat with AI")
|
| 129 |
st.write("Get visualizations and analysis from our Gemini powered agent")
|