fschwartzer commited on
Commit
fcfd1df
1 Parent(s): 0223206

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -187,6 +187,8 @@ if not filtered_df.empty:
187
 
188
  last_df = ultimo_ano[ultimo_ano['Instituição'] == selected_instituicao]
189
  last_df.drop(['Instituição'], axis=1, inplace=True)
 
 
190
  def format_currency(x):
191
  return "R${:,.2f}".format(x)
192
  last_df['Últimos 12 meses'] = last_df['Últimos 12 meses'].apply(format_currency)
@@ -197,7 +199,7 @@ if not filtered_df.empty:
197
  try:
198
  # Calculate the grand total sum of 'Próximos 12 meses' and 'Últimos 12 meses' values
199
  total_sum = sum(float(row['Próximos 12 meses'].replace('R$ ', '').replace(',', '')) for row in data)
200
- total_sum_prev = table_data.iloc[:,-1].replace('R$ ', '', regex=True).replace(',', '', regex=True).astype(float).sum()
201
 
202
  # Append the "Total" row
203
  total_row = pd.DataFrame({
 
187
 
188
  last_df = ultimo_ano[ultimo_ano['Instituição'] == selected_instituicao]
189
  last_df.drop(['Instituição'], axis=1, inplace=True)
190
+ print(last_df)
191
+ last_sum = last_df.iloc[:,-1].sum()
192
  def format_currency(x):
193
  return "R${:,.2f}".format(x)
194
  last_df['Últimos 12 meses'] = last_df['Últimos 12 meses'].apply(format_currency)
 
199
  try:
200
  # Calculate the grand total sum of 'Próximos 12 meses' and 'Últimos 12 meses' values
201
  total_sum = sum(float(row['Próximos 12 meses'].replace('R$ ', '').replace(',', '')) for row in data)
202
+ total_sum_prev = last_sum
203
 
204
  # Append the "Total" row
205
  total_row = pd.DataFrame({