How to use SimpleImputer Class to replace missing values with mean values using Python?
Your error is due to using Simple Imputer's fit and fit_transform on a numpy array. Here's how i used it on a Dataframe

imr = Imputer(missing_values='NaN', strategy='median', axis=0)
imr = imr.fit(data[['age']])
data['age'] = imr.transform(data[['age']]).ravel()



  X.fit = impute.fit_transform().. this is wrong. you can't assign a value to a X.fit() just simply because .fit() is an imputer function, you can't use the method fit() on a numpy array, hence your error! 


Use x[:, 1:3] = imputer.fit_transform(x[:, 1:3]) instead

Hope this helps!