The integer list is essentially a random integer list of mostly integers in an excel file but there are some blocks of zeroes I want to identify. Ex. [3,3,3,0,0,4,0,6,0,0,7]. I just want to run through the list so that I can print: first block of zeroes start at index 3 and end at index 4, second block etc.
The list is a single column in excel, and spans thousands of rows.
The way I am doing that is with the following code:
r = 1
while r+1000 < y:
for q in range(r,y-1):
if sheet.cell_value(q,3) == '0':
start = q
print(str(start))
for e in range(q,y-1):
if sheet.cell_value(e,3) != 0:
r = e
print(str(end))
break
break
The prints are there so I can check if it is going right. But what's happening now in the output is it never stops and only prints the start value.