image_output_11.png image_output_17.png image_output_14.png image_output_13.png image_output_5.png image_output_18.png image_output_7.png image_output_4.png image_output_8.png image_output_16.png image_output_6.png image_output_12.png image_output_3.png image_output_2.png image_output_1.png image_output_10.png image_output_15.png image_output_9.png
import matplotlib.pyplot as plt

import pandas as pd

import seaborn as sns

train = pd.read_csv('../input/tabular-playground-series-mar-2022/train.csv')
test = pd.read_csv('../input/tabular-playground-series-mar-2022/test.csv', index_col='row_id')

train.time = pd.to_datetime(train.time)
train['daytime_id'] = ((train.time.dt.hour * 60 + train.time.dt.minute) / 20).astype(int)
train = train.set_index('row_id', drop=True)
train['roadway'] = train.x.astype('str') + '_' + train.y.astype('str') + '_' + train.direction.astype('str')
train['day_of_week'] = train.time.dt.dayofweek
test.time = pd.to_datetime(test.time)
test['roadway'] = test.x.astype('str') + '_' + test.y.astype('str') + '_' + test.direction.astype('str')
test['day_of_week'] = test.time.dt.dayofweek

plot = sns.histplot(train['congestion'])
plot.set_title('Congestion Histogram')
plt.show()