Skip to content

Instantly share code, notes, and snippets.

@letthedataconfess
Last active January 28, 2021 02:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save letthedataconfess/4b1cd9c90e07cf17397820f92a4fc296 to your computer and use it in GitHub Desktop.
Save letthedataconfess/4b1cd9c90e07cf17397820f92a4fc296 to your computer and use it in GitHub Desktop.
sentiment analysis
nltk.download('stopwords')
stopword_list=stopwords.words('english')
stopword_list.remove('no')
stopword_list.remove('not')
df.review=df.review.apply(lambda x : " ".join(x for x in x.split() if x not in stopword_list))
df['review'][5]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment