Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -120,31 +120,11 @@ ultimo_ano = last_rows[['Institui莽茫o', 'Conta', '脷ltimos 12 meses']]
|
|
120 |
print(ultimo_ano)
|
121 |
|
122 |
with tab1:
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
for _, row in conta_df.iterrows():
|
129 |
-
lines = row['Forecasts'].split('\n')
|
130 |
-
for line in lines[:-1]: # Skip the summary line
|
131 |
-
if line.strip():
|
132 |
-
parts = line.split()
|
133 |
-
value = parts[-1]
|
134 |
-
try:
|
135 |
-
conta_sum += float(value)
|
136 |
-
except ValueError:
|
137 |
-
print(f"Skipping line unable to convert to float: {line}")
|
138 |
-
|
139 |
-
# Append the data to the list
|
140 |
-
data.append({'Conta': conta, 'Modelo': modelo, 'Pr贸ximos 12 meses': conta_sum})
|
141 |
-
|
142 |
-
# Convert the list to a DataFrame
|
143 |
-
table_data = pd.DataFrame(data)
|
144 |
-
total_sum = table_data['Pr贸ximos 12 meses'].sum()
|
145 |
-
|
146 |
-
labels = table_data['Conta']
|
147 |
-
sizes = [(i / total_sum) * 100 for i in table_data['Pr贸ximos 12 meses']]
|
148 |
|
149 |
#fig1, ax1 = plt.subplots()
|
150 |
#ax1.pie(sizes, labels=labels, autopct='%1.1f%%',)
|
|
|
120 |
print(ultimo_ano)
|
121 |
|
122 |
with tab1:
|
123 |
+
municipio = ultimo_ano[ultimo_ano['Institui莽茫o'] == selected_instituicao]
|
124 |
+
|
125 |
+
labels = municipio['Conta']
|
126 |
+
total_sum = municipio['脷ltimos 12 meses'].sum()
|
127 |
+
sizes = [(i / total_sum) * 100 for i in municipio['脷ltimos 12 meses']]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
|
129 |
#fig1, ax1 = plt.subplots()
|
130 |
#ax1.pie(sizes, labels=labels, autopct='%1.1f%%',)
|