Answered step by step
Verified Expert Solution
Question
1 Approved Answer
import pandas as pd import matplotlib.pyplot as plt import seaborn as sns # Data df = pd . read _ csv ( ' transactions -
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
# Data
df pdreadcsvtransactionspetstore.csv
dforig dfcopy
Question
Find any clearly "incorrect" values in the Price column and "clean" the DataFrame to address those values.
Ensure you make the changes to the DataFrame assigned to the variable df
Question
After you've done the cleaning above, remove any column that has more than missing values.
Ensure you make the changes to the DataFrame assigned to the variable df
Question
Address the other missing values. You can replace the values or remvove them, but whatever method you decide to clean the DataFrame, you should no longer have any missing values.
Ensure you make the changes to the DataFrame assigned to the variable df
Question
Determine most common category ProductCategory purchases number of total items for both ProductLine categories. Assign the string name of these categories to their respective variables commoncategorycat & commoncategorydog.
Question
Determine which categories ProductCategory by ProductLine have the median highest Price. Assign the string name of these categories to their respective variables priciestcategorycat & priciestcategorydog.
Question
You want to emphasize to your stakeholders that the total number of product categories sold differ between the two ProductLine categories cat & 'dog'
Create a horizontal bar plot that has ProductCategory on the yaxis and the total number of that category sold using the Quantity by each ProductLine category. Also change the axis labels to something meaningful and add a title.
You will likely want to use Seaborn. Make sure you set the result to the variable ax like the following:
ax # code to create a bar plot
Question
Based on the plot from Question what would you conclude for your stakeholders about what products they should sell? What would be the considerations andor caveats you'd communicate to your stakeholders?
Write at least a couple sentences of your thoughts in a string assigned to the variable answerto
The cell below should look something like this:
answerto
I think that based on the visualization that
Therefore I would communicate with the stakeholders that
Question
The plot you created for Question is good but could be modified to emphasize which products are important for the business.
Create an explanatory visualization that emphasizes the insight you about the product category. This would be a visualization you'd share with the business stakeholders.
Make sure you set the result to the variable ax like the following:
ax # code to create explanatory visualization
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