I am trying to handle the missing data in my dataset using SimpleImputer from sklearn.imputer and my code is as follows :
from sklearn.impute import SimpleImputer
imputer = SimpleImputer(missing_values=np.nan, strategy='mean', verbose=0)
imputer = imputer.fit(X[:,1:3])
X[:,1:3] = imputer.transform(X[:,1:3])
and when imputer.fit line is executed I get the following TypeError :
Exception has occurred: TypeError
'(slice(0, None, None), slice(1, 3, None))' is an invalid key
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…