pd.to_datetime

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

实例:

df.head()

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

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

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

相关文章:

  • 2022-12-23
  • 2021-09-11
  • 2022-12-23
  • 2022-12-23
  • 2022-02-16
  • 2021-09-22
  • 2021-08-28
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
  • 2022-12-23
  • 2021-08-28
  • 2022-01-28
  • 2022-01-11
相关资源
相似解决方案