📜  时间特征提取 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:40.953000             🧑  作者: Mango

代码示例1
new_df=pd.DataFrame({'year':df['Date'].dt.year,
                     'month':df['Date'].dt.month,
                     'day':df['Date'].dt.day,
                     
                      'dayofyear':df['Date'].dt.dayofyear,
                     'week':df['Date'].dt.week,           
                     'dayofweek':df['Date'].dt.dayofweek,
                     'dayofweekname':df['Date'].dt.weekday_name,
                    'quater':df['Date'].dt.quarter})