Update app.py
Browse files
app.py
CHANGED
@@ -71,7 +71,9 @@ if uploaded_file:
|
|
71 |
df_filtered['Month'] = df_filtered['Date'].dt.to_period('M').astype(str) # Convert Period to string for Plotly compatibility
|
72 |
monthly_expenses = df_filtered.groupby('Month')['Amount'].sum()
|
73 |
|
74 |
-
|
|
|
|
|
75 |
st.plotly_chart(fig2)
|
76 |
|
77 |
# 3. Monthly Spending vs Budget (Bar Chart)
|
|
|
71 |
df_filtered['Month'] = df_filtered['Date'].dt.to_period('M').astype(str) # Convert Period to string for Plotly compatibility
|
72 |
monthly_expenses = df_filtered.groupby('Month')['Amount'].sum()
|
73 |
|
74 |
+
# Convert monthly_expenses into DataFrame for correct plotting
|
75 |
+
monthly_expenses_df = monthly_expenses.reset_index()
|
76 |
+
fig2 = px.line(monthly_expenses_df, x='Month', y='Amount', title="Monthly Expenses", labels={"Month": "Month", "Amount": "Amount ($)"})
|
77 |
st.plotly_chart(fig2)
|
78 |
|
79 |
# 3. Monthly Spending vs Budget (Bar Chart)
|