imputets

I try imputing in sklearn but I have an error

别等时光非礼了梦想. 提交于 2021-01-29 06:46:21
问题 I try below code but I have some error. imp=SimpleImputer(missing_values='NaN',strategy="mean") col = veriler.iloc[:,1:4].values type(col) ##numpy.ndarray imp=imp.fit(col) ValueError: Input contains NaN, infinity or a value too large for dtype('float64'). 回答1: You need to convert the infinity values to a bounded value to apply imputation. np.nan_to_num clips nan , inf and -inf to workable values. For example: import numpy as np from sklearn.impute import SimpleImputer imp_mean = SimpleImputer