Round DateTime using Pandas

后端 未结 1 968
天命终不由人
天命终不由人 2021-01-14 18:40

I want to round a DateTime feature such a way that it gets converted to the start value of every 10 minute time interval. Example below shows the desired result:

<         


        
1条回答
  •  无人共我
    2021-01-14 19:12

    Use Series.dt.floor:

    df['Round Time'] = df['DateTime'].dt.floor('10min')
    

    0 讨论(0)
提交回复
热议问题