Spaces:
Build error
Build error
Update pages/market_rent_estimation.py
Browse files
pages/market_rent_estimation.py
CHANGED
|
@@ -21,8 +21,8 @@ def main():
|
|
| 21 |
st.set_page_config(initial_sidebar_state="collapsed", layout="wide")
|
| 22 |
tab1, tab2 = st.tabs(["Comps", "Combined estimation"])#, "Market distributions", "Rexy"])
|
| 23 |
|
| 24 |
-
distances_matrix = np.load('
|
| 25 |
-
df_properties = pd.read_csv("
|
| 26 |
|
| 27 |
|
| 28 |
# update the values of date and price of the historical lease to today date and nan value for price
|
|
@@ -40,7 +40,8 @@ def main():
|
|
| 40 |
|
| 41 |
#apply all filters
|
| 42 |
#
|
| 43 |
-
mask = (df_properties['rented_sf'] >= lease_min_size) & (df_properties['rented_sf'] <= lease_max_size) & (df_properties['building_sf'] >= min_size) & (df_properties['building_sf'] <= max_size)
|
|
|
|
| 44 |
df_properties_filtered = df_properties[mask]
|
| 45 |
|
| 46 |
# create distances matrix for remaining rows
|
|
@@ -150,9 +151,9 @@ def main():
|
|
| 150 |
|
| 151 |
#add poligons on map
|
| 152 |
gdf = gpd.read_file('costar_sm_polygons.geojson')
|
| 153 |
-
|
| 154 |
-
folium.GeoJson(data=
|
| 155 |
-
for _, row in
|
| 156 |
# Convert the row's geometry to GeoJSON
|
| 157 |
geojson = folium.GeoJson(data=row['geometry'].__geo_interface__,
|
| 158 |
style_function=lambda feature: {
|
|
|
|
| 21 |
st.set_page_config(initial_sidebar_state="collapsed", layout="wide")
|
| 22 |
tab1, tab2 = st.tabs(["Comps", "Combined estimation"])#, "Market distributions", "Rexy"])
|
| 23 |
|
| 24 |
+
distances_matrix = np.load('all_data_matrix.npy')
|
| 25 |
+
df_properties = pd.read_csv("all_data.csv", encoding='utf-8')
|
| 26 |
|
| 27 |
|
| 28 |
# update the values of date and price of the historical lease to today date and nan value for price
|
|
|
|
| 40 |
|
| 41 |
#apply all filters
|
| 42 |
#
|
| 43 |
+
mask = (df_properties['rented_sf'] >= lease_min_size) & (df_properties['rented_sf'] <= lease_max_size) & (df_properties['building_sf'] >= min_size) & (df_properties['building_sf'] <= max_size)
|
| 44 |
+
& (df_properties['months_since'] <= st.session_state['months_back']) & (df_properties['market_costar'] <= st.session_state['market_val'])
|
| 45 |
df_properties_filtered = df_properties[mask]
|
| 46 |
|
| 47 |
# create distances matrix for remaining rows
|
|
|
|
| 151 |
|
| 152 |
#add poligons on map
|
| 153 |
gdf = gpd.read_file('costar_sm_polygons.geojson')
|
| 154 |
+
gdf_current_market = gdf[gdf.full_submarket.str.contains(st.session_state['market_val'])]
|
| 155 |
+
folium.GeoJson(data=gdf_current_market.geometry.to_json(), name='geojson').add_to(m)
|
| 156 |
+
for _, row in gdf_current_market.iterrows():
|
| 157 |
# Convert the row's geometry to GeoJSON
|
| 158 |
geojson = folium.GeoJson(data=row['geometry'].__geo_interface__,
|
| 159 |
style_function=lambda feature: {
|