fschwartzer commited on
Commit
ab64c26
1 Parent(s): 502ed02

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -10
app.py CHANGED
@@ -123,18 +123,18 @@ evo_html = """
123
  """
124
 
125
 
 
 
126
  # Create a sidebar for controls
127
  with st.sidebar:
128
- st.sidebar.markdown(title_html, unsafe_allow_html=True)
129
 
130
  # Add a dropdown for filtering "Fonte"
131
  selected_fonte = st.selectbox('Finalidade', data['Fonte'].unique())
132
-
133
  data = data[data['Fonte'] == selected_fonte]
134
 
135
  # Add a dropdown for filtering "Tipo"
136
  selected_tipo = st.selectbox('Tipo de imóvel', data['Tipo'].unique())
137
-
138
  data_tipo = data[data['Tipo'] == selected_tipo]
139
 
140
  custom_address = st.text_input('Informe o endereço', custom_address_initial)
@@ -161,7 +161,6 @@ with st.sidebar:
161
  banho_range = (int(data_tipo['Banh'].min()), int(data_tipo['Banh'].max()))
162
  vaga_range = (int(data_tipo['Vaga'].min()), int(data_tipo['Vaga'].max()))
163
  test_range = (int(data_tipo['Test'].min()), int(data_tipo['Test'].max()))
164
-
165
 
166
  # Add sliders to filter data based
167
  atotal_range = st.slider('Área Total', float(data_tipo['Atotal'].min()), float(data_tipo['Atotal'].max()), (float(data_tipo['Atotal'].min()), float(data_tipo['Atotal'].max())), step=.1 if data_tipo['Atotal'].min() != data_tipo['Atotal'].max() else 0.1)
@@ -176,12 +175,11 @@ with st.sidebar:
176
  if int(data_tipo['Test'].min()) != 0 and int(data_tipo['Test'].max()) != 0:
177
  test_range = st.slider('Testada', int(data_tipo['Test'].min()), int(data_tipo['Test'].max()), (int(data_tipo['Test'].min()), int(data_tipo['Test'].max())), step=1 if data_tipo['Test'].min() != data_tipo['Test'].max() else 1)
178
 
179
- # Initialize checkbox variables
180
  elev_checkbox = False
181
- churr_checkbox = False
182
  esq_checkbox = False
183
 
184
- # Add checkboxes for dummy features
185
  if int(data_tipo['Elevador'].min()) != 0 and int(data_tipo['Elevador'].max()) != 0:
186
  elev_checkbox = st.checkbox('Elevador')
187
  if int(data_tipo['Lot_pos'].min()) != 0 and int(data_tipo['Lot_pos'].max()) != 0:
@@ -200,10 +198,10 @@ with st.sidebar:
200
  (data_tipo['Elevador'] == elev_value) &
201
  (data_tipo['Lot_pos'] == esq_value)]
202
 
 
 
 
203
 
204
- # Links to other apps at the bottom of the sidebar
205
- st.sidebar.markdown(factor_html, unsafe_allow_html=True)
206
- st.sidebar.markdown(evo_html, unsafe_allow_html=True)
207
 
208
 
209
  filtered_data = data_tipo[data_tipo.apply(lambda x: calculate_distance(x['latitude'], x['longitude'], custom_lat, custom_lon), axis=1) <= radius_in_meters]
 
123
  """
124
 
125
 
126
+ import streamlit as st
127
+
128
  # Create a sidebar for controls
129
  with st.sidebar:
130
+ st.markdown(title_html, unsafe_allow_html=True)
131
 
132
  # Add a dropdown for filtering "Fonte"
133
  selected_fonte = st.selectbox('Finalidade', data['Fonte'].unique())
 
134
  data = data[data['Fonte'] == selected_fonte]
135
 
136
  # Add a dropdown for filtering "Tipo"
137
  selected_tipo = st.selectbox('Tipo de imóvel', data['Tipo'].unique())
 
138
  data_tipo = data[data['Tipo'] == selected_tipo]
139
 
140
  custom_address = st.text_input('Informe o endereço', custom_address_initial)
 
161
  banho_range = (int(data_tipo['Banh'].min()), int(data_tipo['Banh'].max()))
162
  vaga_range = (int(data_tipo['Vaga'].min()), int(data_tipo['Vaga'].max()))
163
  test_range = (int(data_tipo['Test'].min()), int(data_tipo['Test'].max()))
 
164
 
165
  # Add sliders to filter data based
166
  atotal_range = st.slider('Área Total', float(data_tipo['Atotal'].min()), float(data_tipo['Atotal'].max()), (float(data_tipo['Atotal'].min()), float(data_tipo['Atotal'].max())), step=.1 if data_tipo['Atotal'].min() != data_tipo['Atotal'].max() else 0.1)
 
175
  if int(data_tipo['Test'].min()) != 0 and int(data_tipo['Test'].max()) != 0:
176
  test_range = st.slider('Testada', int(data_tipo['Test'].min()), int(data_tipo['Test'].max()), (int(data_tipo['Test'].min()), int(data_tipo['Test'].max())), step=1 if data_tipo['Test'].min() != data_tipo['Test'].max() else 1)
177
 
178
+ # Initialize checkbox variables
179
  elev_checkbox = False
 
180
  esq_checkbox = False
181
 
182
+ # Add checkboxes for dummy features
183
  if int(data_tipo['Elevador'].min()) != 0 and int(data_tipo['Elevador'].max()) != 0:
184
  elev_checkbox = st.checkbox('Elevador')
185
  if int(data_tipo['Lot_pos'].min()) != 0 and int(data_tipo['Lot_pos'].max()) != 0:
 
198
  (data_tipo['Elevador'] == elev_value) &
199
  (data_tipo['Lot_pos'] == esq_value)]
200
 
201
+ # Links to other apps at the bottom of the sidebar
202
+ st.sidebar.markdown(factor_html, unsafe_allow_html=True)
203
+ st.sidebar.markdown(evo_html, unsafe_allow_html=True)
204
 
 
 
 
205
 
206
 
207
  filtered_data = data_tipo[data_tipo.apply(lambda x: calculate_distance(x['latitude'], x['longitude'], custom_lat, custom_lon), axis=1) <= radius_in_meters]