Resample hourly TimeSeries with certain starting hour

Resample has an base argument which covers this case:

ts.resample(rule="24H", closed='left', label="left", base=17).sum()

Output:

2012-01-01 17:00:00    24
2012-01-02 17:00:00    24
2012-01-03 17:00:00    12
Freq: 24H

Leave a Comment