pandas的string日期列转化为timestamp(时间戳)

pd.to_datetime

df["年月日"] = pd.to_datetime(df["年月日"])

实例:

df.head()

在这里插入图片描述

#将年月日列从string转为timestamp(时间戳)
df["年月日"] = pd.to_datetime(df["年月日"])
df.head()

在这里插入图片描述

posted @ 2020-02-16 15:31  爱做梦的子浩  阅读(2215)  评论(0编辑  收藏  举报