Update app.py
Browse files
app.py
CHANGED
|
@@ -51,7 +51,7 @@ if uploaded_file is not None:
|
|
| 51 |
fig, ax = plt.subplots()
|
| 52 |
category_spending.plot(kind='pie', autopct='%1.1f%%', ax=ax, figsize=(8, 8))
|
| 53 |
ax.set_ylabel('')
|
| 54 |
-
st.pyplot(fig)
|
| 55 |
|
| 56 |
# Monthly spending trends (Line plot)
|
| 57 |
df['Date'] = pd.to_datetime(df['Date'])
|
|
@@ -64,7 +64,7 @@ if uploaded_file is not None:
|
|
| 64 |
ax.set_ylabel('Amount ($)')
|
| 65 |
ax.set_xlabel('Month')
|
| 66 |
ax.set_title('Monthly Spending Trends')
|
| 67 |
-
st.pyplot(fig)
|
| 68 |
|
| 69 |
# Budget Tracker
|
| 70 |
st.sidebar.header("Budget Tracker")
|
|
@@ -83,7 +83,7 @@ if uploaded_file is not None:
|
|
| 83 |
budget_df.plot(kind='bar', ax=ax, figsize=(10, 6))
|
| 84 |
ax.set_ylabel('Amount ($)')
|
| 85 |
ax.set_title('Budget vs Actual Spending')
|
| 86 |
-
st.pyplot(fig)
|
| 87 |
|
| 88 |
# Suggestions for saving
|
| 89 |
st.write("### Suggested Savings Tips")
|
|
|
|
| 51 |
fig, ax = plt.subplots()
|
| 52 |
category_spending.plot(kind='pie', autopct='%1.1f%%', ax=ax, figsize=(8, 8))
|
| 53 |
ax.set_ylabel('')
|
| 54 |
+
st.pyplot(fig) # Explicitly call st.pyplot for matplotlib images
|
| 55 |
|
| 56 |
# Monthly spending trends (Line plot)
|
| 57 |
df['Date'] = pd.to_datetime(df['Date'])
|
|
|
|
| 64 |
ax.set_ylabel('Amount ($)')
|
| 65 |
ax.set_xlabel('Month')
|
| 66 |
ax.set_title('Monthly Spending Trends')
|
| 67 |
+
st.pyplot(fig) # Explicitly call st.pyplot for matplotlib images
|
| 68 |
|
| 69 |
# Budget Tracker
|
| 70 |
st.sidebar.header("Budget Tracker")
|
|
|
|
| 83 |
budget_df.plot(kind='bar', ax=ax, figsize=(10, 6))
|
| 84 |
ax.set_ylabel('Amount ($)')
|
| 85 |
ax.set_title('Budget vs Actual Spending')
|
| 86 |
+
st.pyplot(fig) # Explicitly call st.pyplot for matplotlib images
|
| 87 |
|
| 88 |
# Suggestions for saving
|
| 89 |
st.write("### Suggested Savings Tips")
|