I want to create a mask on pandas that obeys a time series index.
Suppose I have a pandas series ranging from values 0 to 100. I want to mark the series at a specific set of indices TRUE if it lies between 40 and 80, but in respects to time.
For example, if at t=0, the value of the series is 85, and t=1, the value is 50, I do not want to mark t=1 as true. I would only want to mark it as true if for some time step before T=t, the value is 40 or below and did not go above time step 80.