Nic*_*kD1 2 python datetime pandas
我在 python pandas 中有一些时间戳,Timestamp('2000-02-09 00:00:00')我想将它们转换为Timestamp('2000-02-09 13:00:00'). 仅仅增加 13 小时是行不通的,因为其中一些有不同的时间。你能指出这个问题的解决方案吗?
Timestamp('2000-02-09 00:00:00')
Timestamp('2000-02-09 13:00:00')
Ant*_*pov 7
使用pandas时间戳对象的replace方法:
import pandas as pd t = pd.Timestamp('2000-02-09 00:00:00') t = t.replace(hour=13, minute=0, second=0)
归档时间:
9 年,11 月 前
查看次数:
7102 次
最近记录: