-
-
Save amankharwal/e7a5349201d88e0ae7c305811294f105 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
Most_Positive = f_data[f_data['Positive Sentiment'].between(0.4,1)] | |
Most_Negative = f_data[f_data['Negative Sentiment'].between(0.25,1)] | |
Most_Positive_text = ' '.join(Most_Positive.text) | |
Most_Negative_text = ' '.join(Most_Negative.text) | |
pwc = WordCloud(width=600,height=400,collocations = False).generate(Most_Positive_text) | |
nwc = WordCloud(width=600,height=400,collocations = False).generate(Most_Negative_text) | |
plt.subplot(1,2,1) | |
plt.title('Common Words Among Most Positive Tweets',fontsize=16,fontweight='bold') | |
plt.imshow(pwc) | |
plt.axis('off') | |
plt.subplot(1,2,2) | |
plt.title('Common Words Among Most Negative Tweets',fontsize=16,fontweight='bold') | |
plt.imshow(nwc) | |
plt.axis('off') | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment