Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

nswer the following questions. Import the pandas module. a. Read the data in the

ID: 3705320 • Letter: N

Question

nswer the following questions. Import the pandas module. a. Read the data in the excel file named b. xisx and save this data in a data frame called of the second sheet that is named (Returns) in the excel file (Superstore.xlsi) Superstore mov. C. Read and store these contents it in a data frame called super. d. write the needed code to show the first 5 rows from the data frame super using an appropriate method. e. Write f. Use a suitable command to show only 1 column that is named Sales g. Use a suitable the needed code to show the last 5 rows using an appropriate method. se a suitable command to show the maximum value stored in the 'Sales column. Use a suitable command to show the minimum value stored in the 'Sales' column. write a single command to show the details (count, min, max, mean, std, 25% 50% 75%) about the column 'Quantity' i. j, Use a suitable conditional statement(s) that store(s) the rows in which the State is Texas and the 'Quantity' is below '4' in a data frame named 'super. Show the values in dataframe super I. Using a suitable command, create a calculated column named 'AvE Reviews in the first sheet m. Using a suitable command, sort the' Country' in an ascending order (smallest to largest) and n. Using a suitable command, change the index of the dataframe 'super' to store Orders' by adding 'Sales' and Quantity' and divide it by 2. Display the first five rows of the first_sheet after creating the above calculated column. Sales in a descending order [largest to smallest]. Download this notebook as a PDF. To do that you need to Click on the File Menu, then click on Download As, then choose PDF. See the image below: o.

Explanation / Answer

Since you have not provided superstore.xlsx file, i cannot provide you the outputs. Please run these commands and Let me know if you have any doubts.

a.
import pandas as pd

b.
excel_file = 'Superstore.xlsx'
mov = pd.ExcelFile(excel_file)

c.
super = pd.read_excel(mov, 'Returns')

d.head() command will show by default top 5 rows
super.head()

e.
super.tail(5)

f.
super['Sales']

g.
len(pd.read_excel(excel_file_path, sheetname="Orders"))

h.
super['Sales'].max()

i.
super['Sales'].min()

j.
super[Quantity].describe()

k.
super[ (super['State']=='Taxas') & (super['Quantity'] == 4)]

i.
Orders=pd.read_excel(excel_file_path, sheetname="Orders")

Orders['Avg Reviews']= (Orders['Sales'] + Orders['Quantity'] )/2

Orders.head()

m.
super['Country'].sort_index(ascending=False)
super['Sales'].sort_index(ascending=True)

n.
super.set_index('store')