text_plain_output_1.png
(X_train.shape, X_test.shape)

X_train.dtypes

X_train.isnull().sum()

X_test.isnull().sum()

for df1 in [X_train, X_test]:
    for col in X_train.columns:
        col_median = X_train[col].median()
        df1[col].fillna(col_median, inplace=True)

X_train.isnull().sum()

X_train.head()