I have a pandas DF with datetime index.
Created_Ts value
2001-01-01 06:00:00 199
2001-01-01 06:15:00 299
2001-01-01 07:30:00 399
2001-01-01 07:45:00 400
I want to create the hour of the day from the datetime index.
Current Approach:
df = df.reset_index()
df["hour"] = df["Created_Ts"].dt.hour
It works, but is there a pandas way to create the hour column directly and without resetting the index