text_plain_output_1.png
from termcolor import colored

import pandas as pd

train = pd.read_csv('../input/30-days-of-ml/train.csv', index_col=0)
test = pd.read_csv('../input/30-days-of-ml/test.csv', index_col=0)

train.isnull().sum()

features = train.drop(['target'], axis=1)

num_col = list(train.select_dtypes(include='float64').columns)
cat_cols = list(train.select_dtypes(include='object').columns)
num_col.remove('target')

list(test.columns) == list(features.columns)

test.isnull().sum()

lis = []
for i in features[cat_cols].columns:
    test_vals = set(test[i].unique())
    train_vals = set(features[i].unique())
    lis.append(test_vals.issubset(train_vals))
print(colored(all(lis), 'green'))