You are on page 1of 2

Sentiment Analysis

We then ran the sentiment analysis on our code by creating a new data frame called ‘Sentiments’ using
the VaderSentiments library.
This new data frame analyzed the sentiments of the ‘Messages’ column of our original dataset, and gave
them positive, neutral or negative values in three new columns. It then also made a new column called
“compound” which normalized the sentiments between -1 to 1.
Next, we assigned labels to each value in the compound columns using the following code:

After the sentiments were properly assigned and coded, we ran the following two visualizations to get a
pie chart and a bar graph of our sentiment distribution.
As can be seen from the above two images, the overall sentiment was neutral during the given time
period, but there were a significant number of positive and negative tweets on both sides. In total, there
were 29,088 neutral tweets, 18,587positive tweets and 21,710 negative tweets.

You might also like