Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -17,6 +17,21 @@ with open("./max_dict.json", "r") as f:
|
|
| 17 |
with open("./cities_geo.json", "r") as f:
|
| 18 |
cities_geo = json.load(f)
|
| 19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
# Custom CSS to adjust the slider width
|
| 21 |
|
| 22 |
st.markdown("""
|
|
@@ -39,17 +54,17 @@ with col1:
|
|
| 39 |
with st.container(height=550, 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)
|
| 43 |
-
bathrooms = st.slider('Bathrooms', min_value=min_dict['bathrooms'], max_value=max_dict['bathrooms'], value=2)
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
floors = st.slider('Floors', min_value=min_dict['floors'], max_value=max_dict['floors'], value=1)
|
| 47 |
-
view = st.slider('View', min_value=min_dict['view'], max_value=max_dict['view'], value=0)
|
| 48 |
-
condition = st.slider('Condition', min_value=min_dict['condition'], max_value=max_dict['condition'], value=3)
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
|
| 54 |
st.markdown('</div>', unsafe_allow_html=True)
|
| 55 |
|
|
|
|
| 17 |
with open("./cities_geo.json", "r") as f:
|
| 18 |
cities_geo = json.load(f)
|
| 19 |
|
| 20 |
+
help_dict = {
|
| 21 |
+
'bedrooms': "Select the number of bedrooms in the house. The value ranges from the minimum to the maximum available in the dataset.",
|
| 22 |
+
'bathrooms': "Select the number of bathrooms in the house. The value ranges from the minimum to the maximum available in the dataset.",
|
| 23 |
+
'yr_built': "Select the year the house was built. The value ranges from the earliest to the latest year available in the dataset.",
|
| 24 |
+
'yr_renovated': "Select the year the house was renovated. This value cannot be earlier than the year the house was built and ranges up to the maximum renovation year in the dataset.",
|
| 25 |
+
'floors': "Select the number of floors in the house. The value ranges from the minimum to the maximum number of floors available in the dataset.",
|
| 26 |
+
'view': "Select the quality of the view from the house. The value ranges from 0 (no view) to the highest view quality available in the dataset.",
|
| 27 |
+
'condition': "Select the overall condition of the house. The value ranges from the poorest to the best condition available in the dataset.",
|
| 28 |
+
'sqft_living': "Select the total square footage of the living space. The value ranges from the minimum to the maximum square footage available in the dataset.",
|
| 29 |
+
'sqft_lot': "Select the total square footage of the lot. The value ranges from the minimum to the maximum lot size available in the dataset.",
|
| 30 |
+
'sqft_above': "Select the square footage of the living space above ground level. The value ranges from the minimum to the maximum above-ground square footage available in the dataset.",
|
| 31 |
+
'sqft_basement': "Select the square footage of the basement. The value ranges from the minimum to the maximum basement square footage available in the dataset."
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
|
| 35 |
# Custom CSS to adjust the slider width
|
| 36 |
|
| 37 |
st.markdown("""
|
|
|
|
| 54 |
with st.container(height=550, border=True):
|
| 55 |
city = st.selectbox('City', list(cities_geo.keys())) # Display city dropdown in the first column
|
| 56 |
waterfront = st.checkbox('Waterfront', value=False)
|
| 57 |
+
bedrooms = st.slider('Bedrooms', min_value=min_dict['bedrooms'], max_value=max_dict['bedrooms'], value=3, help=help_dict['bedrooms'])
|
| 58 |
+
bathrooms = st.slider('Bathrooms', min_value=min_dict['bathrooms'], max_value=max_dict['bathrooms'], value=2, help=help_dict['bathrooms'])
|
| 59 |
+
yr_built = st.slider('Year Built', min_value=min_dict['yr_built'], max_value=max_dict['yr_built'], value=2000, help=help_dict['yr_built'])
|
| 60 |
+
yr_renovated = st.slider('Year Renovated', min_value=yr_built, max_value=max_dict['yr_renovated'], value=yr_built, help=help_dict['yr_renovated'])
|
| 61 |
+
floors = st.slider('Floors', min_value=min_dict['floors'], max_value=max_dict['floors'], value=1, help=help_dict['floors'])
|
| 62 |
+
view = st.slider('View', min_value=min_dict['view'], max_value=max_dict['view'], value=0, help=help_dict['view'])
|
| 63 |
+
condition = st.slider('Condition', min_value=min_dict['condition'], max_value=max_dict['condition'], value=3, help=help_dict['condition'])
|
| 64 |
+
sqft_living = st.slider('Square Feet (Living)', min_value=min_dict['sqft_living'], max_value=max_dict['sqft_living'], value=1000, help=help_dict['sqft_living'])
|
| 65 |
+
sqft_lot = st.slider('Square Feet (Lot)', min_value=min_dict['sqft_lot'], max_value=max_dict['sqft_lot'], value=2000, help=help_dict['sqft_lot'])
|
| 66 |
+
sqft_above = st.slider('Square Feet (Above)', min_value=min_dict['sqft_above'], max_value=max_dict['sqft_above'], value=1000, help=help_dict['sqft_above'])
|
| 67 |
+
sqft_basement = st.slider('Square Feet (Basement)', min_value=min_dict['sqft_basement'], max_value=max_dict['sqft_basement'], value=0, help=help_dict['sqft_basement'])
|
| 68 |
|
| 69 |
st.markdown('</div>', unsafe_allow_html=True)
|
| 70 |
|