Merge pull request #97 from yx-xyc/patch-1

Update Day 1_Data_Preprocessing.py
This commit is contained in:
Yong Mao
2021-01-13 16:25:02 +08:00
committed by GitHub

View File

@ -17,7 +17,7 @@ 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")
# imputer = SimpleImputer(missing_values=np.nan, strategy="mean")
from sklearn.preprocessing import Imputer
imputer = Imputer(missing_values = "NaN", strategy = "mean", axis = 0)
imputer = imputer.fit(X[ : , 1:3])