I have a nested for loop something like:
for x in df['text']:
for i in x:
if i in someList:
count++
Where df['text'] is a series of lists containing words such as ['word1', 'word2', 'etc']
I know I can just use the for format but I want to convert it into a lambda function.
I tried doing:
df['in'] = df['text'].apply(lambda x: [count++ for i in x if i in someList])
but it is not proper syntax. How can I modify to get the function to what I desire?