text_plain_output_1.png
import matplotlib as mpl

import matplotlib.pyplot as plt

import pandas as pd

df_train = pd.read_csv('../input/tabular-playground-series-mar-2022/train.csv')
df_train['time'] = pd.to_datetime(df_train['time'])
df_train.drop(['row_id'], axis=1, inplace=True)
df_test = pd.read_csv('../input/tabular-playground-series-mar-2022/test.csv')

fig, ax = plt.subplots(2, 2, figsize=(15, 15))
ax[0, 0].hist(df_train['congestion'], bins=100)
ax[0, 0].set_xlabel('Congestion')

ax[0, 1].hist(df_train['x'])
ax[0, 1].set_xlabel('x')

ax[1, 0].hist(df_train['y'])
ax[1, 0].set_xlabel('y')

ax[1,1].hist(df_train['direction'], bins=df_train['direction'].nunique(), align='right')
ax[1, 1].set_xlabel('direction')

fig.show()

fig, ax = plt.subplots(1, 2, figsize=(15, 7))
ax[0].hist2d(df_train['congestion'], df_train['day'], bins=[50, 7], cmap=mpl.cm.Blues)
ax[0].set_xlabel('Congestion')
ax[0].set_ylabel('Weekday')
ax[1].hist2d(df_train['congestion'], df_train['month'], bins=[50, 12], cmap=mpl.cm.Blues, range=([0, 100], [0, 11]))
ax[1].set_xlabel('Congestion')
ax[1].set_ylabel('Month')
plt.show()