I can write down the following Python code:
for j1 > 2: time1 = i1 for i2 > i1: if j2 < 2: time2 = i2 break
Purpose of the above code:
Consider a set of touples M = [(i1,j1),(i2,j2),(i3,j3),etc]
what I want to do is (because in my case i = time and j = some physical value) isolate the interval in which my physical value is above the value 2. I want to be able to say, at the end, that the physical value j is above 2 for exactly 2.5 seconds, for example.
I wrote in in python code above, does anyone know how to rewrite it in Mathematica code?