April 25th

image from rotten tomatoes
#gather tweets from the movie Miss Congeniality
c = twint.Config()
c.Search = "Miss Congeniality"
c.Limit = 20000
c.Since = "2000-12-14" #released December 14, 2000
c.Until = "2021-04-26"
c.Pandas = True
# twint.run.Search(c)MC = twint.storage.panda.Tweets_df
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
vader = SentimentIntensityAnalyzer()
MC['positive sentiment score'] = MC['tweet'].apply(lambda x: vader.polarity_scores(x)['pos'])
MC['negative sentiment score'] = MC['tweet'].apply(lambda x: vader.polarity_scores(x)['neg'])
MC['neutral sentiment score'] = MC['tweet'].apply(lambda x: vader.polarity_scores(x)['neu'])
MC['compound sentiment score'] = MC['tweet'].apply(lambda x: vader.polarity_scores(x)['compound'])
#distribution of vader score
fig, ax = plt.subplots(figsize=(15,7))
ax = sns.distplot(MissCongeniality['compound sentiment score'], color = 'firebrick')
plt.xlabel('Sentiment Score', fontsize=18)
plt.ylabel('Tweets per Score', fontsize=18)
plt.title('VADER Sentiment of Miss Congeniality', fontsize=22)
#determining a neutral sentiment value, negative sentiment value, and positive sentiment value
sentiment = {'negative':0, 'neutral':0, 'positive':0}
for x in MissCongeniality['compound sentiment score']:
if x < -.1:
sentiment['negative'] += 1
elif -0.1 <= x <= 0.1: #space for the score to be neutral beyond a perfect 0
sentiment['neutral'] += 1
sentiment['positive'] += 1
print('Miss Congeniality sentiment count:', sentiment)




Aspiring Data Scientist

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Data visualisation or dataviz — Definition for dummies

A Simple Guide to A/B Testing in Python

How To Design Machine Learning Model Using Only With Just CSV

R Basics — Everything You Need to Know to Get Started with R

Tired of Data Quality Discussions?

PyStory — A Datapane initiative featuring the best data stories

Materializing Data Bias(9)| FMP

How to become a good earner in Airbnb?

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Raizel Bernstein

Raizel Bernstein

Aspiring Data Scientist

More from Medium

Poxycodone Park Opioid Death Memorial

Interaction with Ketanji Brown Jackson on the Internet

Beauty Attracts The Eyes, But Personality Captures the Heart