Published in


Seaborn Python Review

Reviewing theses Plotting & Statistics Packs — #PySeries#Episode 20

Visualization Exercise

The Data

This classic dataset contains the prices and other attributes of almost 54,000 diamonds. It’s a great dataset for beginners learning to work with data analysis and visualization.

Content:price price in US dollars ($326 — $18,823)
carat weight of the diamond (0.2–5.01)
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 (I1 (worst), SI2, SI1, VS2, VS1, VVS2, VVS1, IF (best))
x length in mm (0–10.74)
y width in mm (0–58.9)
z depth in mm (0–31.8)
depth total depth percentage = z / mean(x, y) = 2 * z / (x + y) (43–79)
table width of top of diamond relative to widest point (43–95)
Follow the instructions to recreate the plots using this data:
Import pandas, matplotlib.pyplot and seaborn
Read in the data set diamonds.csv
Create a scatterplot of price versus carat as shown below:
Make the previous plot larger with figure size (10, 8):
`Create a histogram of the price column with displot as shown below. Observe the x-axis limits. Also, set bins=50 and height=8:
Create a count plot of the instances per cut type as shown below:
7. Create a large box plot figure showing the price distribution per cut type as shown below. Set (10, 8) as figure size.
Figure out how to change the ordering of the box plot as shown below:

Credits & References


Posts Related:

00Episode#PySeries — Python — Jupiter Notebook Quick Start with VSCode — How to Set your Win10 Environment to use Jupiter Notebook



J of Jungle + 3 Plats Arduino/RPi/Pic = J3

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store

Hi, Guys o/ I am J3! I am just a hobby-dev, playing around with Python, Django, Lego, Arduino, Raspy, PIC, AI… Welcome! Join us!