image_output_1.png
import pandas as pd

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

df = pd.read_csv('../input/911.csv')

df['Reason'] = df['title'].apply(lambda title: title.split(':')[0])

df['Departments'] = df['title'].apply(lambda title: title.split(':')[1])

Month_grouping = df.groupby('Month').count()

df['Date'] = df['timeStamp'].apply(lambda t: t.date())

df.groupby(by=['Day of Week', 'Hour']).count()['Reason']

df_hour = df.groupby(by=['Day of Week', 'Hour']).count()['Reason'].unstack()

df_month = df.groupby(by=['Day of Week', 'Month']).count()['Reason'].unstack()
df_month.head()