时间序列分析的熊猫日期时间问题

时间:2021-03-20 18:16:59

标签: python pandas datetime

enter image description here

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

1 个答案:

答案 0 :(得分:0)

尝试以下日期格式。

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