def find_sequences(errors, epsilon):
    """Find sequences of values that are above epsilon.

    This is done following this steps:

        * create a boolean mask that indicates which value are above epsilon.
        * shift this mask by one place, filing the empty gap with a False
        * compare the shifted mask with the original one to see if there are changes.
        * Consider a sequence start any point which was true and has changed
        * Consider a sequence end any point which was false and has changed
    """
    above = pd.Series(errors > epsilon)
    shift = above.shift(1).fillna(False)
    change = above != shift

    index = above.index
    starts = index[above & change].tolist()
    ends = (index[~above & change] - 1).tolist()
    if len(ends) == len(starts) - 1:
        ends.append(len(above) - 1)

    return list(zip(starts, ends))
Find sequences of values that are above epsilon.

    This is done following this steps:

        * create a boolean mask that indicates which value are above epsilon.
        * shift this mask by one place, filing the empty gap with a False
        * compare the shifted mask with the original one to see if there are changes.
        * Consider a sequence start any point which was true and has changed
        * Consider a sequence end any point which was false and has changed