arssite commited on
Commit
5c5cd04
·
verified ·
1 Parent(s): 37be67b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -15,7 +15,13 @@ numerical_cols = ["Price", "Size"]
15
  scaler = MinMaxScaler()
16
  property_df[numerical_cols] = scaler.fit_transform(property_df[numerical_cols])
17
 
18
- property_df["Bedrooms"] = property_df["Bedrooms"].astype(int)
 
 
 
 
 
 
19
 
20
  categorical_cols = ["Location", "Condition", "Type"]
21
  label_encoders = {}
 
15
  scaler = MinMaxScaler()
16
  property_df[numerical_cols] = scaler.fit_transform(property_df[numerical_cols])
17
 
18
+ # property_df["Bedrooms"] = property_df["Bedrooms"].astype(int)
19
+ # Handle missing Bedrooms BEFORE casting
20
+ property_df["Bedrooms"] = (
21
+ property_df["Bedrooms"]
22
+ .fillna(property_df["Bedrooms"].median())
23
+ .astype(int)
24
+ )
25
 
26
  categorical_cols = ["Location", "Condition", "Type"]
27
  label_encoders = {}