application_vnd.jupyter.stderr_output_1.png image_output_1.png
import matplotlib.pyplot as plt

import pandas as pd

import seaborn as sns

events = pd.read_csv('{0}events.csv'.format(DATA_PATH)).loc[:, ['timestamp', 'device_id']]
events['timestamp'] = pd.to_datetime(events['timestamp'])

ax = sns.distplot(events['hour'])

ax.set_title('Events by hour')
ax.set_xlim(xmin = 0, xmax = 24)
ax.set_xlabel('Hour of day')
plt.show()

ax1 = sns.distplot(events['hour_recentred'])
ax1.set_xlim(xmin=-2, xmax=22)
ax1.set_xlabel('Hour of day')
ax1.set_title('Events by hour -- recentered')