-
-
Save amankharwal/cb3e539f94a46da658532ff324fe50f9 to your computer and use it in GitHub Desktop.
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
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
hello, can you please explain to me dfx.loc[[index,2],'Sentiment']=sent what does the int 2 here means? what does it refer to?