a = np.array([True, False, False, True, True, False, False, True, False])
np.diff(np.insert(np.where(np.diff(a) == 1)[0] + 1, 0, 0))[::2]
Count the number of occurrences between markers in a python list