I would like to resample a pandas series with timedelta
starting with the zero interval (timedelta(seconds=0)
) instead of the first occurrence.
For example, for
from datetime import timedelta
from random import sample
s = pd.Series(1, index=[timedelta(minutes=m) for m in sample(range(1, 100), 10)])
s.resample('1h').count()
I get
0 days 00:12:00 9
0 days 01:12:00 1
But I need
0 days 00:00:00 9
0 days 01:00:00 0
0 days 02:00:00 1