I have a list with this shape:
temp5=[]
for i in range(0,len(df)):
temp5.append(df['text'][i].split())
df['each']=temp5
df['each']
and the result is like this:
now I want to remove some elements of the previous list. I want to check if each word of the previous list is similar to the following list, remove it from it. the second list is like this:
stopwords = open('stop_words.txt','r').read().split('\n')
print(stopwords)
now I wrote this code to delete the same words of each list from the first one. but all I receive is NONE. Could you please help me with it?
for k in range(0,len(df)):
for j in df['each'][k][:]:
for f in stopwords:
if f==j:
temp6.append(df['each'][k][:].remove(f))
print(temp6)