ClarzW commited on
Commit
f54cb42
·
verified ·
1 Parent(s): cec167d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -209,9 +209,12 @@ if viz_button:
209
  # Sort the DataFrame by 'Date'
210
  #monthly_df = monthly_df.sort_values(by = 'Date')
211
 
 
 
 
212
  # Extract dates and expenses for plotting
213
- dates = st.session_state['expenses']['Date']
214
- expenses = st.session_state['expenses']['Amount']
215
 
216
 
217
  # Create a line plot
 
209
  # Sort the DataFrame by 'Date'
210
  #monthly_df = monthly_df.sort_values(by = 'Date')
211
 
212
+ # Group by 'Category' and sum the 'Amount'
213
+ date_group = st.session_state['expenses'].groupby('Date')['Amount'].sum().reset_index()
214
+
215
  # Extract dates and expenses for plotting
216
+ dates = date_group['Date']
217
+ expenses = date_group['Amount']
218
 
219
 
220
  # Create a line plot