Trying to import Imputer from sklearn,
import pandas as pd dataset = pd.read_csv(\'Data.csv\') X = dataset.iloc[:, :-1].values y = dataset.iloc[:, 3].values
After the version scikit-learn SimpleImputer/Imputer has been changed its location from sklearn.preprocessing to package sklearn.impute.
So, kindly use the below line of code to import.
from sklearn.impute import SimpleImputer
Thank you!