Python: how to find to consecutive positive negative values in an array? : I have the following array:

    X
    array([ 3.5, -3, 5.4, 3.7, 14.9, -7.8, -3.5, 2.1])

For each values of `X`  I know its recording time `T`. I want to find the indexes between two consecutive positive-negative or viceversa. Concluding I would like an array like

    Y = array([ T(1)-T(0), T(2)-T(1),  T(5)-T(4), T(7)-T(6)])