PeriodIndex月份轉換季度報錯,更改寫作方式
報錯
B_month['Statistics_Q'] = pd.PeriodIndex(B_month.Statistics_date, freq='Q')
TypeError: Incorrect dtype
更正
B_month['Statistics_Q'] = pd.PeriodIndex(B_month["Statistics_date"].values, freq='Q')
PeriodIndex月份轉換季度報錯,更改寫作方式
B_month['Statistics_Q'] = pd.PeriodIndex(B_month.Statistics_date, freq='Q')
TypeError: Incorrect dtype
B_month['Statistics_Q'] = pd.PeriodIndex(B_month["Statistics_date"].values, freq='Q')