text_plain_output_1.png
import matplotlib.pyplot as plt

import pandas as pd

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

import seaborn as sns

train = pd.read_csv('/kaggle/input/tabular-playground-series-mar-2022/train.csv')
test = pd.read_csv('/kaggle/input/tabular-playground-series-mar-2022/test.csv')
submission = pd.read_csv('/kaggle/input/tabular-playground-series-mar-2022/test.csv')

train.isnull().sum()

sns.set_style('whitegrid')
fig = plt.figure(figsize=(12, 8))
ax1 = fig.add_subplot(3, 2, 1)
sns.countplot(x='x', data=train, palette='Set2')
plt.xticks()
ax1.spines['right'].set_visible(False)
ax1.spines['top'].set_visible(False)
ax1.set_xlabel('x value', fontsize=14, labelpad=10)
ax1.set_ylabel('Count', fontsize=14, labelpad=10)
ax1.set_title('Distribution of x - Train Set', loc='center', fontsize=14, fontweight='bold')
ax2 = fig.add_subplot(3, 2, 2)
sns.countplot(x='x', data=test, palette='Set2')
plt.xticks()
ax2.spines['right'].set_visible(False)
ax2.spines['top'].set_visible(False)
ax2.set_xlabel('x value', fontsize=14, labelpad=10)
ax2.set_ylabel('Count', fontsize=14, labelpad=10)
ax2.set_title('Distribution of x - Test Set', loc='center', fontsize=14, fontweight='bold')
ax3 = fig.add_subplot(3, 2, 3)
sns.countplot(x='y', data=train, palette='Set2')
plt.xticks()
ax3.spines['right'].set_visible(False)
ax3.spines['top'].set_visible(False)
ax3.set_xlabel('y value', fontsize=14, labelpad=10)
ax3.set_ylabel('Count', fontsize=14, labelpad=10)
ax3.set_title('Distribution of y - Train Set', loc='center', fontsize=14, fontweight='bold')
ax4 = fig.add_subplot(3, 2, 4)
sns.countplot(x='y', data=test, palette='Set2')
plt.xticks()
ax4.spines['right'].set_visible(False)
ax4.spines['top'].set_visible(False)
ax4.set_xlabel('y value', fontsize=14, labelpad=10)
ax4.set_ylabel('Count', fontsize=14, labelpad=10)
ax4.set_title('Distribution of y - Test Set', loc='center', fontsize=14, fontweight='bold')
ax5 = fig.add_subplot(3, 2, 5)
sns.countplot(x='direction', data=train, palette='Set2')
plt.xticks()
ax5.spines['right'].set_visible(False)
ax5.spines['top'].set_visible(False)
ax5.set_xlabel('direction', fontsize=14, labelpad=10)
ax5.set_ylabel('Count', fontsize=14, labelpad=10)
ax5.set_title('Distribution of direction - Train Set', loc='center', fontsize=14, fontweight='bold')
ax6 = fig.add_subplot(3, 2, 6)
sns.countplot(x='direction', data=test, palette='Set2')
plt.xticks()
ax6.spines['right'].set_visible(False)
ax6.spines['top'].set_visible(False)
ax6.set_xlabel('direction', fontsize=14, labelpad=10)
ax6.set_ylabel('Count', fontsize=14, labelpad=10)
ax6.set_title('Distribution of direction - Test Set', loc='center', fontsize=14, fontweight='bold')
fig.tight_layout()