def zero_crossing_last(frames):
    """Finds the last zero crossing in frames"""
    frames = N.array(frames)

    crossings = N.where(N.diff(N.sign(frames)))
    # crossings = N.where(frames[:n] * frames[1:n + 1] < 0)

    if len(crossings[0]) == 0:
        print "No zero crossing"
        return 1 - len(frames)
    return crossings[0][-1]
dataset/ETHPy150Open ucbvislab/radiotool/radiotool/utils.py/zero_crossing_last/swapped operands of `-`