print(“\n — — Time Series Feature Extraction — -”) # Extract Year, Month, DayName, and Hour from the InvoiceDate column df[‘Year’] = df[‘InvoiceDate’].dt.year df[‘Month’] = df[‘InvoiceDate’].dt.month df[‘DayName’] = df[‘InvoiceDate’].dt.day_name() df[‘Hour’] = df[‘InvoiceDate’].dt.hour print(“New time features added: Year, Month, DayName, Hour.”) print(df[[‘InvoiceDate’, ‘Year’, ‘Month’, ‘DayName’, ‘Hour’]].head())