for ind in range(len(myList)):
    if ind == len(myList) - 1:
        break
for i in range(ind - n, ind + 1):
    if i >= 0 and myList[i] == 'x':
        ind += i
fill missing values of sequence with neural networks