how to count stopwords in df

81

how to count stopwords in df -

from nltk.corpus import stopwords    
stop_words = set(stopwords.words('english'))

df['n'] = df['text'].str.split().apply(lambda x: len(set(x) & stop_words))

Comments

Submit
0 Comments