for x,y in words:
for z in x:
if z in stopwords:
del x[x.index(z)]
This is my code. The data in words is a list of Tuples where a tuple looks like this:
(list of words, metadata)
The purpose of my code is to remove all the stopwords from the list of words. The only problem with this is, that the stopwords are not removed afterwards...
What exactly did I do wrong? I already tried to do it with
x.pop(x.index(z))
but that doesn't seem to make a difference.