Skip to content

Instantly share code, notes, and snippets.

@wandabwa2004
Created July 22, 2019 08:52
Show Gist options
  • Save wandabwa2004/0fb40eed07cf224122578835f9cd8a3e to your computer and use it in GitHub Desktop.
Save wandabwa2004/0fb40eed07cf224122578835f9cd8a3e to your computer and use it in GitHub Desktop.
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
analyzer = SentimentIntensityAnalyzer()
sentiment_vader = df['review_body'].apply(lambda x: analyzer.polarity_scores(x))
df = pd.concat([df,sentiment_vader.apply(pd.Series)],1)
df.describe()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment