image_output_1.png
from sklearn.preprocessing import Imputer

from sklearn.preprocessing import Imputer

import pandas as pd

dataset = pd.read_csv('../input/train.csv')

X = dataset.iloc[:, [4, 2, 6, 5]].values
y = dataset.iloc[:, 1].values

from sklearn.preprocessing import Imputer
imputer = Imputer(missing_values='NaN', strategy='mean', axis=0)
imputer = imputer.fit(X[:, 1:])
X[:, 1:] = imputer.transform(X[:, 1:])

realdata = pd.read_csv('../input/test.csv')

X_real = realdata.iloc[:, [3, 1, 5, 4]].values
X_real

from sklearn.preprocessing import Imputer
imputer = Imputer(missing_values='NaN', strategy='mean', axis=0)
imputer = imputer.fit(X_real[:, 1:])
X_real[:, 1:] = imputer.transform(X_real[:, 1:])
X_real