I have a list as follows:
a = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
I would like to remove zeros that repeat 12 times in a row from the list to have the desired output of
a = [1, 1, 0, 0, 1, 1]
I tried using index but soon realized this would also remove zeros that dont repeat 12 times...
index = [0]
new_a = np.delete(a, index)
print(new_a)