Skip to content

Instantly share code, notes, and snippets.

@tommyhuang1
Created February 12, 2017 22:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tommyhuang1/4f8f7560ec94ab9b3ab3554b82e9b3c6 to your computer and use it in GitHub Desktop.
Save tommyhuang1/4f8f7560ec94ab9b3ab3554b82e9b3c6 to your computer and use it in GitHub Desktop.
Gabapentin Scatter Plot
import sys
import numpy as np
reload(sys)
sys.setdefaultencoding('utf8')
from textblob import TextBlob
wikiA = map(lambda x: TextBlob(x),DataWithRating.Review)
resultA=[]
for i in range(len(wikiA)):
k = wikiA[i].sentiment.polarity
resultA.append(k)
DataWithRating['Polarity'] = resultA
import seaborn as sns
plt.scatter(DataWithRating['Polarity'], DataWithRating['Rating'],c='b')
plt.title('Gabapentin')
plt.xlabel('Polarity')
plt.ylabel('Rating')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment