【问题标题】:Panda Date time Problem for Time series Analysis时间序列分析的熊猫日期时间问题
【发布时间】:2026-01-19 11:00:02
【问题描述】:

enter image description here

我正在解决该怎么做。我需要用于时间序列分析的年份日期时间数据(如 1974 年、1975 年 ... 2020 年)。但我每行都得到 1970 年。有人可以帮忙吗?

【问题讨论】:

标签: python pandas datetime


【解决方案1】:

尝试以下日期格式。

df.Period = pd.to_datetime(df.Period, format='%Y')

【讨论】:

  • 真的很有帮助。非常感谢您的友好和有效的支持。