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.
key