0
0
Matplotlibdata~10 mins

Why Seaborn complements Matplotlib - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to import Seaborn with its common alias.

Matplotlib
import [1] as sns
Drag options to blanks, or click blank then click option'
Apandas
Bmatplotlib
Cnumpy
Dseaborn
Attempts:
3 left
💡 Hint
Common Mistakes
Importing matplotlib as sns instead of seaborn
Using numpy or pandas as sns
2fill in blank
medium

Complete the code to create a simple scatter plot using Seaborn.

Matplotlib
sns.scatterplot(x='total_bill', y='tip', data=[1])
Drag options to blanks, or click blank then click option'
Aplt
Btips
Cnp
Ddf
Attempts:
3 left
💡 Hint
Common Mistakes
Passing plt or np instead of a DataFrame
Using an undefined variable like df without loading data
3fill in blank
hard

Fix the error in the code to set a Seaborn style for Matplotlib plots.

Matplotlib
sns.set_style([1])
Drag options to blanks, or click blank then click option'
Ascatter
Bblue
Cdarkgrid
Dplot
Attempts:
3 left
💡 Hint
Common Mistakes
Using color names instead of style names
Passing plot types instead of style names
4fill in blank
hard

Fill both blanks to create a Seaborn histogram with kernel density estimate.

Matplotlib
sns.histplot(data=[1], x='total_bill', kde=[2])
Drag options to blanks, or click blank then click option'
Atips
BTrue
CFalse
Dplt
Attempts:
3 left
💡 Hint
Common Mistakes
Passing plt instead of a DataFrame
Setting kde to False or a string
5fill in blank
hard

Fill all three blanks to create a Seaborn boxplot grouped by day and colored by smoker status.

Matplotlib
sns.boxplot(x=[1], y='total_bill', hue=[2], data=[3])
Drag options to blanks, or click blank then click option'
A'day'
B'smoker'
Ctips
D'total_bill'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'total_bill' as x or hue instead of 'day' or 'smoker'
Passing plt or other variables instead of the dataset