Update Day 1_Data_Preprocessing.py
On line 20, the input of missing_value should be np.nan. This is the default of this function in the newest version of sklearn.
This commit is contained in:
@ -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])
|
||||
|
||||
Reference in New Issue
Block a user