I want to resample a TimeSeries in daily (exactly 24 hours) frequence starting at a certain hour.
Like:
index = date_range(datetime(2012,1,1,17), fre
2020 Update: for dataframes
Use the base
keyword as referred in the doc:
Code example:
df.resample(pd.Timedelta('24 hours'), # or '24H'
base=17 # <-- ADD THIS
).sum()
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