Created
May 25, 2020 03:19
-
-
Save shashankvemuri/732bffcd00a46666df0b11527a980d14 to your computer and use it in GitHub Desktop.
perform sentiment analysis
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sentiment Analysis | |
analyzer = SentimentIntensityAnalyzer() | |
columns = ['Ticker', 'Date', 'Time', 'Headline'] | |
news = pd.DataFrame(parsed_news, columns=columns) | |
scores = news['Headline'].apply(analyzer.polarity_scores).tolist() | |
df_scores = pd.DataFrame(scores) | |
news = news.join(df_scores, rsuffix='_right') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment