Spaces:
Sleeping
Sleeping
Commit
•
8a769c2
1
Parent(s):
34bc951
Update app.py
Browse files
app.py
CHANGED
@@ -154,7 +154,14 @@ if not filtered_df.empty:
|
|
154 |
# Convert the list to a DataFrame
|
155 |
table_data = pd.DataFrame(data)
|
156 |
|
157 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
total_sum = sum(float(row['Valor Monetário'].replace('R$ ', '').replace(',', '')) for row in data)
|
159 |
|
160 |
# Append the "Total" row
|
@@ -169,15 +176,7 @@ if not filtered_df.empty:
|
|
169 |
|
170 |
# Append these rows to the table data
|
171 |
table_data = pd.concat([table_data, saude_row, educacao_row], ignore_index=True)
|
172 |
-
|
173 |
-
last_df = ultimo_ano[ultimo_ano['Instituição'] == selected_instituicao]
|
174 |
-
last_df.drop(['Instituição'], axis=1, inplace=True)
|
175 |
-
def format_currency(x):
|
176 |
-
return "R${:,.2f}".format(x)
|
177 |
-
last_df['Últimos 12 meses'] = last_df['Últimos 12 meses'].apply(format_currency)
|
178 |
-
table_data = pd.merge(table_data, last_df)
|
179 |
|
180 |
-
|
181 |
# Display the table
|
182 |
st.table(table_data)
|
183 |
|
|
|
154 |
# Convert the list to a DataFrame
|
155 |
table_data = pd.DataFrame(data)
|
156 |
|
157 |
+
last_df = ultimo_ano[ultimo_ano['Instituição'] == selected_instituicao]
|
158 |
+
last_df.drop(['Instituição'], axis=1, inplace=True)
|
159 |
+
def format_currency(x):
|
160 |
+
return "R${:,.2f}".format(x)
|
161 |
+
last_df['Últimos 12 meses'] = last_df['Últimos 12 meses'].apply(format_currency)
|
162 |
+
table_data = pd.merge(table_data, last_df)
|
163 |
+
|
164 |
+
# Calculate the grand total sum of all 'Conta' values
|
165 |
total_sum = sum(float(row['Valor Monetário'].replace('R$ ', '').replace(',', '')) for row in data)
|
166 |
|
167 |
# Append the "Total" row
|
|
|
176 |
|
177 |
# Append these rows to the table data
|
178 |
table_data = pd.concat([table_data, saude_row, educacao_row], ignore_index=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
179 |
|
|
|
180 |
# Display the table
|
181 |
st.table(table_data)
|
182 |
|