Skip to content

Instantly share code, notes, and snippets.

@amankharwal

amankharwal/netflix.py Secret

Created Jan 16, 2021
Embed
What would you like to do?
dfx=dff[['release_year','description']]
dfx=dfx.rename(columns={'release_year':'Release Year'})
for index,row in dfx.iterrows():
z=row['description']
testimonial=TextBlob(z)
p=testimonial.sentiment.polarity
if p==0:
sent='Neutral'
elif p>0:
sent='Positive'
else:
sent='Negative'
dfx.loc[[index,2],'Sentiment']=sent
dfx=dfx.groupby(['Release Year','Sentiment']).size().reset_index(name='Total Content')
dfx=dfx[dfx['Release Year']>=2010]
fig4 = px.bar(dfx, x="Release Year", y="Total Content", color="Sentiment", title="Sentiment of content on Netflix")
fig4.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment