如何将列转换为熊猫时间戳?
我的数据框中有一个列,上面有'2022-06-03T00:00:00.000Z'
,我想将这些(将其(将其放置)转换为pd.timestamp
) 。我看到了许多答案,他在如何转换为np.datetime64
以及如何转换数据框架的任意列,但无法弄清楚如何将其应用于覆盖范围pd.timestamp < /代码>。
I have a column in my DataFrame with values like '2022-06-03T00:00:00.000Z'
and I want to convert these (in place) to pd.Timestamp
. I see many answers he on how to convert to np.datetime64
and on how do convert arbitrary columns of DataFrames, but can't figure out how to apply these to covering to pd.Timestamp
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用PD.TO_DATETIME方法
我认为这解决了您的问题
只是您需要在方法中主动UTC参数
Use from pd.to_datetime method
I think this solve your problem
Just you need to active utc argument in your method