当我尝试用我的缺失值填充我的缺失值时,我的数据集已分发到X和y均为数据帧格式:
TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
dataSet = pd.read_csv('Data.csv')
X = dataSet.iloc[:, :-1]
y = dataSet.iloc[:, 3]
y = pd.DataFrame(y)
#Taking care of missing Data
from sklearn.preprocessing import Imputer
imputer = Imputer(missing_values="Nan", strategy="mean", axis=0)
imputer = imputer.fit(X.iloc[:, 1:3])
X.iloc[:,1:3] = imputer.transform(X.iloc[:,1:3])
我希望我的数据必须填充平均法力值