I have a df
with the usual timestamps as an index:
2011-04-01 09:30:00
2011-04-01 09:30:10
...
2011-04-01 09:36:20
...
2011-04-01 09:37:30
How can I create a column to this dataframe with the same timestamp but rounded to the nearest 5th minute interval? Like this:
index new_col
2011-04-01 09:30:00 2011-04-01 09:35:00
2011-04-01 09:30:10 2011-04-01 09:35:00
2011-04-01 09:36:20 2011-04-01 09:40:00
2011-04-01 09:37:30 2011-04-01 09:40:00
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…