I have a dataFrame like this, I would like to group every 60 minutes and start grouping at 06:30.
data
index
2017-02-14 06:29:57 11198648
2017-02-14 06:30:01 11198650
2017-02-14 06:37:22 11198706
2017-02-14 23:11:13 11207728
2017-02-14 23:21:43 11207774
2017-02-14 23:22:36 11207776
I am using:
df.groupby(pd.TimeGrouper(freq='60Min'))
I get this grouping:
data
index
2017-02-14 06:00:00 x1
2017-02-14 07:00:00 x2
2017-02-14 08:00:00 x3
2017-02-14 09:00:00 x4
2017-02-14 10:00:00 x5
but I am looking for this result:
data
index
2017-02-14 06:30:00 x1
2017-02-14 07:30:00 x2
2017-02-14 08:30:00 x3
2017-02-14 09:30:00 x4
2017-02-14 10:30:00 x5
How can I tell the function to start grouping at 6:30 at one-hour intervals?
If it can not be done by the .groupby(pd.TimeGrouper(freq='60Min')), how is the best way to do it?
A salute and thanks very much in advance
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…