text_html_output_1.png
from nltk.sentiment.vader import SentimentIntensityAnalyzer

from sklearn.utils import shuffle

import matplotlib.pyplot as plt

import pandas as pd

data_file = '../input/Amazon_Unlocked_Mobile.csv'
data = pd.read_csv(data_file)

data_df = pd.DataFrame(data)

data_df = shuffle(data_df)

data_df = data_df.dropna()

import matplotlib.pyplot as plt
ylabel = data_df['Price']
xlabel = data_df['Rating']

ylabel2 = data_df['Price']
xlabel2 = data_df['Review Votes']

ylabel3 = data_df['Rating']
xlabel3 = data_df['Review Votes']

corr_matrix = data_df.corr()
corr_matrix['Rating'].sort_values(ascending=False)

corr_matrix = data_df.corr()
corr_matrix['Price'].sort_values(ascending=False)

all_reviews = data_df['Reviews']

data_df = data_df.reset_index(drop=True)

all_reviews = data_df['Reviews']
all_sent_values = []
all_sentiments = []

from nltk.sentiment.vader import SentimentIntensityAnalyzer
def sentiment_value(paragraph):
    analyser = SentimentIntensityAnalyzer()
    result = analyser.polarity_scores(paragraph)
    score = result['compound']
    return round(score, 1)

for i in range(0, 20000):
    all_sent_values.append(sentiment_value(all_reviews[i]))

xaxis = []
for i in range(0, 20000):
    xaxis.append(i)
ylabel_new_1 = all_sent_values[:20000]
xlabel = xaxis
plt.figure(figsize=(9, 9))
plt.xlabel('ReviewIndex')
plt.ylabel('SentimentValue(-1 to 1)')
plt.plot(xlabel, ylabel_new_1, 'ro', alpha=0.04)
plt.title('Scatter Intensity Plot of Sentiments')
plt.show()