def pairwise(iterable):
    """s -> (s0,s1), (s1,s2), (s2, s3), ..."""
a, b = itertools.tee(iterable)
next(b, None)
return zip(a, b)
diff = [round(abs(x / float(y)), 1) for x, y in pairwise(your_iterable)]
Calculate factor difference between two list items