Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Perform the tasks and answer the questions using Python code. Display results when applicable. Take screenshots of your work. To start performing each task, import
Perform the tasks and answer the questions using Python code. Display results when applicable. Take screenshots of your work.
To start performing each task, import the libraries pandas matplotlib.pyplot and Seaborn you will need to work with data and plot the graphs.
Load the "diamonds" dataset from the Seaborn package.
The explanation for each column is as given below:
price price in US dollars $ $
carat weight of the diamond
cut quality of the cut Fair Good, Very Good, Premium, Ideal
color diamond colour, from J worst to D best
clarity a measurement of how clear the diamond is Iworst SI SI VS VS VVS VVS IF best
x length in mm
y width in mm
z depth in mm
depth total depth percentage z meanx y z x y
table width of top of diamond relative to widest point
Task
i Load the "diamonds" dataset from the Seaborn package to an object.
ii Find the datatype of the object into which you have loaded the "diamonds" dataset.
iii View the top and bottom rows of the data.
iv Get the dimensions of the data. Find the number of rows and columns in the data.
v Display the structure of the data all column names along with their data types.
vi Display the summary statistics of all the columns in your data.
Hint: Explore the functions available in pandas dataframe to perform tasks iiivi
Task
Using Seaborn, plot a histogram for the "price' field. Also, display the curve line on the histogram that depicts the shape of the distribution.
Task
Visually show how many types of cuts are there in the data and how many records we have for each type of cut use Seaborn Verify the plot with actual values use functions in pandas
Task
Visually display the mean price of the diamonds based on the different types of cuts. Which type of cut has highest average price use Seaborn Verify the plot outputs with actual values.
Task
Visually display the number of records we have in the diamond data corresponding to a particular cut and color use Seaborn Verify with actual values. Hint: Use the crosstab function available in pandas
Task
Using lineplot, find the average carat for diamonds of different cut and color. Verify the display with actual values. Hint: use groupby
Task
Using scatterplot, find the relation between:
i Carat and price of diamonds
ii Carat and x dimension
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