Skip to content

Instantly share code, notes, and snippets.

@jonathanoheix
Created December 18, 2018 09:52
Show Gist options
  • Save jonathanoheix/78386c817b96142b35e880536ae8a6bc to your computer and use it in GitHub Desktop.
Save jonathanoheix/78386c817b96142b35e880536ae8a6bc to your computer and use it in GitHub Desktop.
# plot sentiment distribution for positive and negative reviews
import seaborn as sns
for x in [0, 1]:
subset = reviews_df[reviews_df['is_bad_review'] == x]
# Draw the density plot
if x == 0:
label = "Good reviews"
else:
label = "Bad reviews"
sns.distplot(subset['compound'], hist = False, label = label)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment