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

train_df = pd.read_csv('/kaggle/input/tabular-playground-series-aug-2022/train.csv')
test_df = pd.read_csv('/kaggle/input/tabular-playground-series-aug-2022/test.csv')
sample_submission_df = pd.read_csv('/kaggle/input/tabular-playground-series-aug-2022/sample_submission.csv')

train_df.dtypes

test_df.dtypes

train_df.columns

test_df.columns

train_null_count = train_df.isna().sum().to_dict()
df_train = pd.DataFrame([train_null_count.keys(), train_null_count.values()]).T
df_train.rename(columns={0: 'FeatureName', 1: 'NullCountTrain'}, inplace=True)
df_train

test_null_count = test_df.isna().sum().to_dict()
df_test = pd.DataFrame([test_null_count.keys(), test_null_count.values()]).T
df_test.rename(columns={0: 'FeatureName', 1: 'NullCountTest'}, inplace=True)
df_test

object_columns = list(train_df.select_dtypes(include=['object']).columns)
numeric_columns = [item for item in train_df.columns if item not in object_columns + ['failure']]

(train_df[object_columns].dtypes, test_df[numeric_columns].dtypes)