Answered step by step
Verified Expert Solution
Question
1 Approved Answer
import pandas as pd import numpy as np # % matplotlib inline #import pandas _ profiling import seaborn as sns from sklearn.metrics import roc _
import pandas as pd
import numpy as np
#matplotlib inline
#import pandasprofiling
import seaborn as sns
from sklearn.metrics import rocaucscore
amazonDatapdreadcsvAmazonUnlockedMobile.csv
amazonData.head
amazonData.describe
amazonData.info
#plot to see how rating is distributed
snscountplotamazonDataRating
#Data cleaning
amazonData.dropduplicateskeepFalse,inplaceTrue
amazonDataamazonData.dropna
rowcountamazonData.shape
rowcount
#relation between price and rating
#snsregplotx'Price',y'Rating',dataamazonData
amazonData.isnullsum
amazonDataReviewshead
amazonDataReviews
sentiDataamazonDataReviews"Rating"
sentiDatasentiDatailoc:
sentiDatahead
sentiDataReviews
#distinct products
amazonDataProduct Name"nunique
#distinct brand
amazonDataBrand Name"nunique
#Top Brand Names
pivot pdpivottableamazonData
values Rating 'Review Votes'
index Brand Name'
columns
aggfuncnpsum, npmean, npcountnonzero
marginsTrue, fillvaluesortvaluesbycountnonzero', 'Rating' ascendingFalsefillna
topmostprods pivotreindexheadn
topmostprods topmostprods.resetindex
topmostprods
###### Top products in Samsung
dfsamsung amazonData.locamazonDataBrand Name'isinSamsung
pivot pdpivottabledfsamsung,
values Rating 'Review Votes'
index Product Name'
columns
aggfuncnpsum, npmean, npcountnonzero
marginsTrue, fillvaluesortvaluesbycountnonzero', 'Rating' ascendingFalsefillna
topmostprodssamsung pivot.reindexheadn
topmostprodssamsung topmostprodssamsung.resetindex
topmostprodssamsung
###### Top products in apple
dfapple amazonData.locamazonDataBrand Name'isinApple
pivot pdpivottabledfapple,
values Rating 'Review Votes'
index Product Name'
columns
aggfuncnpsum, npmean, npcountnonzero
marginsTrue, fillvaluesortvaluesbycountnonzero', 'Rating' ascendingFalsefillna
topmostprodsapple pivot.reindexheadn
topmostprodsapple topmostprodsapple.resetindex
topmostprodsapple
#installing NLTK package
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started