text_html_output_1.png
import matplotlib.pyplot as plt

import pandas as pd

import seaborn as sns

traindf = pd.read_csv('/kaggle/input/spaceship-titanic/train.csv')
testdf = pd.read_csv('/kaggle/input/spaceship-titanic/test.csv')
data_cleaner = [traindf, testdf]

sns.set_style('whitegrid')
plt.axis('equal')

categorical_feats = ['HomePlanet', 'CryoSleep', 'Destination', 'VIP']
fig = plt.figure(figsize=(10, 16))
for i, var_name in enumerate(categorical_feats):
    ax = fig.add_subplot(4, 1, i + 1)
    sns.countplot(data=traindf, x=var_name, axes=ax, hue='Transported')
    ax.set_title(var_name)
fig.tight_layout()
plt.show()