Question: import pandas as pd pathSuperstore = r'Sample - Superstore.xlsx' superstoreData = pd.read_excel(pathSuperstore) Using superstoreData: Create the count, mean, standard deviation (std), minimun (min), and maximum
import pandas as pd pathSuperstore = r'Sample - Superstore.xlsx' superstoreData = pd.read_excel(pathSuperstore) Using superstoreData: Create the count, mean, standard deviation (std), minimun (min), and maximum (max) of the sales and profits for region in each year (10 pts) Your output should be similar to the following. Instead of state, you should have region Create a pie chart illustrate the total sales per region (10 pts) The pie chart will have 4 slices representing the 4 regions The total sales will correspond to the size of the slices Return the top 3 orders in each region based on the total sales (10 pts) You can use a user-defined function following the lecture notes Return the top 3 orders in each region in 2018 based on the highest total sales (10 pts) You can use an user-defined function following the lecture notes Create a column called "Shipping Time" representing the number of days between the Order Date and the Ship Date (5 pts) The difference between two datetime64 type variables returns a timedelta type variable You can use dt.days to convert a timedelta to the number of days. Also, you can use Google search to see how to convert a timedelta to an int. Here is an example https://www.kite.com/python/answers/how-to-convert-a-timedelta-column-in-a-pandas-dataframe-to-a-days-column-in-python Calculate the correlation between "Shipping Time" and Sales (5 pts) You can look at previous lecture notes if you forgot how to compute correlations. Return the top 3 orders in each region in 2018 based on the lowest total "Shipping Time" (10 pts) You can use an user-defined function following the lecture notes Plot the total profit per region and year of order date (10 pts) year of order date goes in the x axis, total profit goes in the y axis, and region is the color You can use seaborn to create the plot
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
