我创建了“日期”系列:
Date = pd.Series(pd.date_range('2005-06-30',
periods = 63, freq = '3M'))
哪个工作正常:
Date.head()
输出
0 2005-06-30
1 2005-09-30
2 2005-12-31
3 2006-03-31
4 2006-06-30
dtype: datetime64[ns]
然后,当我尝试将其添加到我的 df 时,我只得到 NaT 值:
Median_Property_Prices['Date'] = Date
Median_Property_Prices.head()
输出
Period | Central_&_Greater_London_Median_Property_Price | Date
----------|------------------------------------------------|-------
2005 - Q2 | 275034.852 | NaT
2005 - Q3 | 281568.432 | NaT
2005 - Q4 | 293130.952 | NaT
2006 - Q1 | 299590.252 | NaT
2006 - Q2 | 299385.228 | NaT
我错过了什么?为什么日期列中没有季度数据?