danielritchie commited on
Commit
857bde5
·
verified ·
1 Parent(s): 24ddde8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -16,7 +16,7 @@ df = pd.DataFrame(dataset['train'])
16
  df.replace("No Data", pd.NA, inplace=True)
17
 
18
  # Handle missing numerical values with mean
19
- df.fillna(df.mean(), inplace=True)
20
 
21
  # Handle missing categorical values with mode
22
  for col in df.select_dtypes(include=['object']).columns:
 
16
  df.replace("No Data", pd.NA, inplace=True)
17
 
18
  # Handle missing numerical values with mean
19
+ df.fillna(df.select_dtypes(include=['number']).mean(), inplace=True)
20
 
21
  # Handle missing categorical values with mode
22
  for col in df.select_dtypes(include=['object']).columns: