Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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))
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #count #stopwords #df
ADD COMMENT
Topic
Name
3+9 =