fschwartzer commited on
Commit
098ca40
1 Parent(s): ad5d544

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -2,7 +2,6 @@ import streamlit as st
2
  import pandas as pd
3
  import numpy as np
4
 
5
-
6
  df = pd.read_csv('last_results.csv')
7
 
8
  image1 = 'images/rs_pmpa.PNG'
@@ -44,13 +43,14 @@ with st.sidebar:
44
  selected_conta = st.selectbox('Seleciona Conta', df['Conta'].unique())
45
 
46
  # Filter the DataFrame based on selected values
47
- filtered_df = df[(df['Instituição'] == selected_instituicao) & (df['Conta'] == selected_conta)]
48
 
49
- # Create two columns
50
- col1, col2 = st.columns(2)
 
 
51
 
52
  # Display the Forecasts values in the first column
53
- col1.header('Forecasts Values')
54
 
55
  if not filtered_df.empty:
56
  data_string = filtered_df['Forecasts'].iloc[0]
@@ -68,11 +68,11 @@ else:
68
  col1.warning('No data available for the selected filters.')
69
 
70
  # Display the Forecasts values as line plots in the second column
71
- col2.header('Forecasts Line Plots')
72
 
73
  if not filtered_df.empty:
74
  data_string = filtered_df['Forecasts'].iloc[0]
75
-
76
  # Create a list to store data for each period
77
  data = []
78
 
@@ -96,4 +96,4 @@ if not filtered_df.empty:
96
  col2.line_chart(chart_data.set_index('Period'))
97
 
98
  else:
99
- col2.warning('No data available for the selected filters.')
 
2
  import pandas as pd
3
  import numpy as np
4
 
 
5
  df = pd.read_csv('last_results.csv')
6
 
7
  image1 = 'images/rs_pmpa.PNG'
 
43
  selected_conta = st.selectbox('Seleciona Conta', df['Conta'].unique())
44
 
45
  # Filter the DataFrame based on selected values
 
46
 
47
+ # Set custom width for columns
48
+ col1_width = 600
49
+ col2_width = 800
50
+ col1, col2 = st.columns([col1_width, col2_width])
51
 
52
  # Display the Forecasts values in the first column
53
+ col1.header('Valores previstos')
54
 
55
  if not filtered_df.empty:
56
  data_string = filtered_df['Forecasts'].iloc[0]
 
68
  col1.warning('No data available for the selected filters.')
69
 
70
  # Display the Forecasts values as line plots in the second column
71
+ col2.header('Gráfico com previsões')
72
 
73
  if not filtered_df.empty:
74
  data_string = filtered_df['Forecasts'].iloc[0]
75
+
76
  # Create a list to store data for each period
77
  data = []
78
 
 
96
  col2.line_chart(chart_data.set_index('Period'))
97
 
98
  else:
99
+ col2.warning('No data available for the selected filters.')