Member-only story
Interview task: Make a scatter plot between price and carat in the diamonds dataset
If an individual is going to go on an interview for a position in data science, it goes without saying that he is likely to be asked to perform a task to show his competency in the subject.
One such task would be to create a scatter plot between the price and carat of the diamond dataset.
The diamonds dataset is loaded into the seaborn library. Seaborn is a Python data visualisation library that provides a high level interface for drawing attractive and informative statistical graphs.
In addition to using the diamonds dataset that is part of the seaborn library, the scatter plot can also be drawn with this library as well. Before drawing the scatter plot, however, it will first be necessary to load the diamonds dataset into the Python interpreter and IDE, as seen in the Python code below:-
After the diamonds dataset is loaded into the program, it is a relatively easy matter to call up the scatterplot function, as seen in the Python code below:-
Scatter plots can also be created using Python’s other data visualisation library, matplotlib, but I prefer to use seaborn for its simplicity and brevity.