finding the first condition in a time series

shift the values by one position, so you can compare at a “one-off” index. From there, it’s simply a matter of filtering with the dual condition

df['Return'] < -3 and df['shifted'] > -3

With those clues, can you handle the coding details?

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top