[Solved] Compare strings of a column in a dataframe with a set of words in a list
Ok, let’s assume we have a dataframe data and list negative_words like this: data = pd.DataFrame({ ‘Tweets’ : [‘This is bad’, ‘This is terrible’, ‘This is good’, ‘This is great’], }) negative_words = [‘bad’, ‘terrible’] We can then do something like: 1) We can use a lambda function with any: # create lambda with any: … Read more