def big_diff(y):
    val = y.values
r = val[0]
for i, x in enumerate(val):
    d = r - x
if abs(d) >= 5:
    yield i, 1 if d < 0 else -1
r = x
pandas: Keep only every row that has cumulated change by a threshold?