For this given list:
a = [1, 0, 0, 1, 1, 1, 3, 0,
1, 1, 4, 2, 1, 1, 2, 1, 1, 1, 1,
0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 5]
I would like to split the list into sublists of zeros and nonzero values to have the desired output of
a = [[1], [0,0], [1,1,1,3], [0],
[1,1,3,2,1,1,2,1,1,1,1,],
[0], [1], [0], [1,1,1], [0,0,0], [1,5]]
I know how to split a list into a certain length of sublists, but I don't think I can use that method here...