I want to create vector/array of when DataFrame index, which is a DateTimeIndex, is between hours of 8 and 14.
This works but is very slow:
permitted = flose.index.to_series().apply(lambda x: 1 if 8 <= x.hour <= 14 else 0)
I am tried variations of this but always get errors:
permitted = np.where(8 <= flose.index.values.hour <= 14 ,1,0)