In the function below I only want to use the data after the first 5600 elements in the list, so I delete that in this function, but everytime I call this function it deletes the first 5600 elements of the already shorter list. Is there a way to fix this?
sd = np.std(baseline(output,20*tijdstap(output),kolom),ddof=1)
for i in range(5600):
verschil = np.diff(channel(output,kolom))
for i in range(len(verschil)):
if abs(verschil[i]) > 5*sd:
starttijd = -10 + i/tijdstap(output)
it deletes 5600 elements every time because delete removes the element from the list and you won’t be able to get back the original list once it deletes an element. Rather try slicing like max suggested, however if you alter any element in slice the original list might get affected(unless you are fine with it), I would suggest you create a deep copy of the slice and then operate on it.