data = [3, 7, 4, 0, 1, 3, 7, 4, 0, 5]
a = [list(i[1]) for i in itertools.groupby(data, key=lambda i: i == 0)]
a
[i for i in a if i != [0]]
How to slice list into contiguous groups of non-zero integers in Python