Created
February 12, 2017 22:23
-
-
Save tommyhuang1/4f8f7560ec94ab9b3ab3554b82e9b3c6 to your computer and use it in GitHub Desktop.
Gabapentin Scatter Plot
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
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