【发布时间】:2021-06-06 04:57:59
【问题描述】:
我的 pandas DataFrame 中有一个时间列,包含超过 800,000 行。时间格式是这样的:
08:28:31
08:28:35
08:28:44
08:28:44
我想将此格式转换为每小时,这意味着如果第一次是 08:28:31,那么第二次时间应该是每小时 09:28:31 等。我们如何在 python 中实现这一点使用 DateTime 库
输出数据:
08:28:31
09:28:31
...
23:28:31
08:28:35
09:28:35
...
23:28:35
08:28:44
...
08:28:44
...
【问题讨论】:
-
请改写,就是你要问的。看不懂
-
这能回答你的问题吗? How to change the datetime format in pandas
-
@jezrael 没错!
-
3rd ->10:28:31 , 4th-> 11:28:31, 5th->12:28:31 等等!
-
是的!正是。
标签: python pandas datetime time rows