RMHalak commited on
Commit
06fbd01
·
verified ·
1 Parent(s): 30c4965

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -26
app.py CHANGED
@@ -36,7 +36,7 @@ col1, col2 = st.columns([1, 2]) # Adjust the width ratios as needed
36
  with col1:
37
  st.subheader('Features')
38
 
39
- with st.container(height=800, border=True):
40
  city = st.selectbox('City', list(cities_geo.keys())) # Display city dropdown in the first column
41
  waterfront = st.checkbox('Waterfront', value=False)
42
  bedrooms = st.slider('Bedrooms', min_value=min_dict['bedrooms'], max_value=max_dict['bedrooms'], value=3)
@@ -82,28 +82,5 @@ with col2:
82
  price_placeholder = st.empty()
83
  price_placeholder.subheader(f'Predicted Price: ${predicted_price[0][0]:,.2f}')
84
  map_data = pd.DataFrame(cities_geo[city])
85
- # with st.container(height=800, border=True):
86
- # st.map(map_data, zoom=11)
87
-
88
- # Define a PyDeck Layer with map_data
89
- layer = pdk.Layer(
90
- "ScatterplotLayer",
91
- map_data,
92
- get_position="[lon, lat]",
93
- get_color="[200, 30, 0, 160]",
94
- get_radius=200,
95
- )
96
-
97
- # Define a PyDeck View (you can adjust height here)
98
- view_state = pdk.ViewState(
99
- latitude=map_data['latitude'],
100
- longitude=map_data['longitude'],
101
- zoom=11,
102
- pitch=50,
103
- )
104
-
105
- # Create a PyDeck chart with the defined layer and view
106
- deck = pdk.Deck(layers=[layer], initial_view_state=view_state, height=800)
107
-
108
- # Display the map using st.pydeck_chart
109
- st.pydeck_chart(deck)
 
36
  with col1:
37
  st.subheader('Features')
38
 
39
+ with st.container(height=500, border=True):
40
  city = st.selectbox('City', list(cities_geo.keys())) # Display city dropdown in the first column
41
  waterfront = st.checkbox('Waterfront', value=False)
42
  bedrooms = st.slider('Bedrooms', min_value=min_dict['bedrooms'], max_value=max_dict['bedrooms'], value=3)
 
82
  price_placeholder = st.empty()
83
  price_placeholder.subheader(f'Predicted Price: ${predicted_price[0][0]:,.2f}')
84
  map_data = pd.DataFrame(cities_geo[city])
85
+ with st.container(height=500, border=True):
86
+ st.map(map_data, zoom=11)