text_plain_output_1.png
from sklearn.impute import SimpleImputer

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

import xgboost as xgb
train = pd.read_csv('../input/tabular-playground-series-sep-2021/train.csv')
test = pd.read_csv('../input/tabular-playground-series-sep-2021/test.csv')

y_train = train['claim']
X_train = train.drop(columns='claim')

from sklearn.feature_selection import mutual_info_classif
from sklearn.impute import SimpleImputer
numerical_transformer = SimpleImputer(strategy='constant', fill_value=0)

imputed_X_train = pd.DataFrame(numerical_transformer.fit_transform(X_train))
imputed_X_train.columns = X_train.columns

cols_with_missing = [col for col in imputed_X_train.columns if imputed_X_train[col].isnull().any()]
print(cols_with_missing)