Spaces:
Running
Running
Commit
•
2e5f1e1
1
Parent(s):
fcfd1df
Update app.py
Browse files
app.py
CHANGED
@@ -80,12 +80,16 @@ filtered_df = pd.concat(adjusted_rows)
|
|
80 |
#col1, col2, col3 = st.columns(3) # This divides the page into three equal parts
|
81 |
|
82 |
# Set custom width for columns
|
83 |
-
col1_width =
|
84 |
-
col2_width =
|
85 |
-
|
|
|
86 |
|
87 |
# Display the Forecasts values in the first column
|
88 |
-
col1.header('
|
|
|
|
|
|
|
89 |
|
90 |
if not filtered_df.empty:
|
91 |
data_string = filtered_df['Forecasts'].iloc[0]
|
@@ -101,12 +105,12 @@ if not filtered_df.empty:
|
|
101 |
num_float = float(value)
|
102 |
monetary_value = f'R$ {num_float:,.2f}' # Adding commas for thousands separator
|
103 |
mes += 1
|
104 |
-
|
105 |
else:
|
106 |
-
|
107 |
|
108 |
# Display the Forecasts values as line plots in the second column
|
109 |
-
|
110 |
|
111 |
if not filtered_df.empty:
|
112 |
data_string = filtered_df['Forecasts'].iloc[0]
|
@@ -134,15 +138,20 @@ if not filtered_df.empty:
|
|
134 |
chart_data = chart_data.sort_values(by='Period')
|
135 |
|
136 |
# Display line chart with "period" on X-axis and "Monetary Value" on Y-axis
|
137 |
-
|
138 |
|
139 |
else:
|
140 |
-
|
141 |
|
142 |
# Display the table in the third column
|
143 |
#col3 = st.columns(1) # You can use st.columns(1) to create a single column layout
|
144 |
|
145 |
-
|
|
|
|
|
|
|
|
|
|
|
146 |
if not filtered_df.empty:
|
147 |
# Filter the DataFrame for the selected institution
|
148 |
tab_df = df[df['Instituição'] == selected_instituicao]
|
@@ -231,7 +240,7 @@ if not filtered_df.empty:
|
|
231 |
st.error(f"Error in processing data: {str(e)}")
|
232 |
|
233 |
else:
|
234 |
-
|
235 |
|
236 |
|
237 |
st.markdown("""
|
|
|
80 |
#col1, col2, col3 = st.columns(3) # This divides the page into three equal parts
|
81 |
|
82 |
# Set custom width for columns
|
83 |
+
col1_width = 260
|
84 |
+
col2_width = 260
|
85 |
+
col3_width = 260
|
86 |
+
col1, col2, col3 = st.columns([col1_width, col2_width, col3_width])
|
87 |
|
88 |
# Display the Forecasts values in the first column
|
89 |
+
col1.header('Composição da RLIT')
|
90 |
+
|
91 |
+
# Display the Forecasts values in the first column
|
92 |
+
col2.header('Valores previstos')
|
93 |
|
94 |
if not filtered_df.empty:
|
95 |
data_string = filtered_df['Forecasts'].iloc[0]
|
|
|
105 |
num_float = float(value)
|
106 |
monetary_value = f'R$ {num_float:,.2f}' # Adding commas for thousands separator
|
107 |
mes += 1
|
108 |
+
col2.write(f"Mês {mes}: {monetary_value}")
|
109 |
else:
|
110 |
+
col2.warning('No data available for the selected filters.')
|
111 |
|
112 |
# Display the Forecasts values as line plots in the second column
|
113 |
+
col3.header('Gráfico com previsões')
|
114 |
|
115 |
if not filtered_df.empty:
|
116 |
data_string = filtered_df['Forecasts'].iloc[0]
|
|
|
138 |
chart_data = chart_data.sort_values(by='Period')
|
139 |
|
140 |
# Display line chart with "period" on X-axis and "Monetary Value" on Y-axis
|
141 |
+
col3.line_chart(chart_data.set_index('Period'))
|
142 |
|
143 |
else:
|
144 |
+
col3.warning('No data available for the selected filters.')
|
145 |
|
146 |
# Display the table in the third column
|
147 |
#col3 = st.columns(1) # You can use st.columns(1) to create a single column layout
|
148 |
|
149 |
+
col4_width = 400
|
150 |
+
col5_width = 400
|
151 |
+
col4, col5 = st.columns([col4_width, col5_width)
|
152 |
+
|
153 |
+
col4.header('Realizado X Previsto')
|
154 |
+
|
155 |
if not filtered_df.empty:
|
156 |
# Filter the DataFrame for the selected institution
|
157 |
tab_df = df[df['Instituição'] == selected_instituicao]
|
|
|
240 |
st.error(f"Error in processing data: {str(e)}")
|
241 |
|
242 |
else:
|
243 |
+
col5.warning('No data available for the selected filters.')
|
244 |
|
245 |
|
246 |
st.markdown("""
|