我正在学习机器,我在尝试删除缺失值的同时编写了上面的代码
TypeError:__init __()有一个意外的关键字参数,我得到了一个 “ missing_vaules”错误,该错误在哪里,我该如何解决?
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
#kodlar
#veri yükleme
veriler=pd.read_csv("eksikveriler.csv")
print(veriler)
from sklearn.preprocessing import Imputer
imputer= Imputer(missing_vaules='NaN',strategy='mean',axix=0)
Yas=veriler.iloc[:,1:4].values
imputer=Imputer.fit(Yas[:,1:4])
Yas[:,1:4]=Imputer.transform(Yas[:,1:4])
print(Yas)
答案 0 :(得分:0)
imputer= Imputer(missing_vaules='NaN',strategy='mean',axix=0) Yas=veriler.iloc[:,1:4].values
应该是
imputer= Imputer(missing_values='NaN',strategy='mean',axix=0) Yas=veriler.iloc[:,1:4].values
修复了values
的拼写错误。