fschwartzer commited on
Commit
7d074fa
1 Parent(s): cdcda6d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -121,9 +121,14 @@ if not filtered_df.empty:
121
  # Create a DataFrame from the list
122
  table_data = pd.DataFrame(data)
123
 
124
- # Add a row for the sum
125
  total_sum = table_data['Valor Monetário'].str.replace('R$ ', '').str.replace(',', '').astype(float).sum()
126
- table_data = table_data.append({'Período': 'Total', 'Valor Monetário': f'R$ {total_sum:,.2f}'}, ignore_index=True)
 
 
 
 
 
127
 
128
  # Display the table
129
  col3.table(table_data)
 
121
  # Create a DataFrame from the list
122
  table_data = pd.DataFrame(data)
123
 
124
+ # Calculate the sum
125
  total_sum = table_data['Valor Monetário'].str.replace('R$ ', '').str.replace(',', '').astype(float).sum()
126
+
127
+ # Create a DataFrame for the "Total" row
128
+ total_row = pd.DataFrame({'Período': ['Total'], 'Valor Monetário': [f'R$ {total_sum:,.2f}']})
129
+
130
+ # Concatenate the "Total" row with the existing table data
131
+ table_data = pd.concat([table_data, total_row], ignore_index=True)
132
 
133
  # Display the table
134
  col3.table(table_data)