From 71e0465c9b7362c0fb02e05dfa2c4c02d04e03b7 Mon Sep 17 00:00:00 2001 From: Yong Mao Date: Tue, 18 Feb 2020 09:44:49 +0800 Subject: [PATCH] new version of scikit-learn api --- Code/Day 1_Data_Preprocessing.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Code/Day 1_Data_Preprocessing.py b/Code/Day 1_Data_Preprocessing.py index 39776f0..d81deb2 100644 --- a/Code/Day 1_Data_Preprocessing.py +++ b/Code/Day 1_Data_Preprocessing.py @@ -15,6 +15,9 @@ print("Y") print(Y) #Step 3: Handling the missing data +# If you use the newest version of sklearn, use the lines of code commented out +# from sklearn.impute import SimpleImputer +# imputer = SimpleImputer(missing_values="NaN", strategy="mean") from sklearn.preprocessing import Imputer imputer = Imputer(missing_values = "NaN", strategy = "mean", axis = 0) imputer = imputer.fit(X[ : , 1:3])