Group Datetime in panda into three hourly intervals Group Datetime in panda into three hourly intervals pandas pandas

Group Datetime in panda into three hourly intervals


You haven't provided much detail, but you can use the 'TimeGrouper':

df.groupby(pd.TimeGrouper(key='your_time_column', freq='3H')).count()

The key parameter is optional if your time is the index.