Answered step by step
Verified Expert Solution
Link Copied!

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:
1) price - price in US dollars ($326 $18,823)
2) carat - weight of the diamond (0.25.01)
3) cut - quality of the cut (Fair, Good, Very Good, Premium, Ideal)
4) color - diamond colour, from J (worst) to D (best)
5) clarity - a measurement of how clear the diamond is (I1(worst), SI2, SI1, VS2, VS1, VVS2, VVS1, IF (best))
6) x - length in mm (010.74)
7) y - width in mm (058.9)
8) z - depth in mm (031.8)
9) depth - total depth percentage = z / mean(x, y)=2* z /(x + y)(4379)
10) table - width of top of diamond relative to widest point (4395)
Task 1
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 5 and bottom 5 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 iii-vi.
Task 2
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 3
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 4
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 5
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 6
Using lineplot, find the average carat for diamonds of different cut and color. Verify the display with actual values. (Hint: use groupby)
Task 7
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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Rules In Database Systems Third International Workshop Rids 97 Sk Vde Sweden June 26 28 1997 Proceedings Lncs 1312

Authors: Andreas Geppert ,Mikael Berndtsson

1997th Edition

3540635165, 978-3540635161

More Books

Students also viewed these Databases questions

Question

6. Explain the strengths of a dialectical approach.

Answered: 1 week ago