Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to import the seaborn library as sns.
Data Analysis Python
import [1] as sns
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Importing matplotlib as sns
Importing pandas as sns
Importing numpy as sns
✗ Incorrect
Seaborn is imported as sns to use its plotting functions like pairplot.
2fill in blank
mediumComplete the code to load the 'iris' dataset using seaborn.
Data Analysis Python
data = sns.[1]('iris')
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using read_csv which is a pandas function
Using load_iris which is from sklearn
Using get_data which is not a seaborn function
✗ Incorrect
The function load_dataset loads example datasets like 'iris' in seaborn.
3fill in blank
hardFix the error in the code to create a pair plot of the data.
Data Analysis Python
sns.pairplot(data=[1])
plt.show() Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Passing 'iris' instead of the variable data
Passing undefined variables like df or dataset
✗ Incorrect
The variable holding the dataset is named data, so it must be passed to pairplot.
4fill in blank
hardFill both blanks to create a pair plot showing only numeric features and coloring by species.
Data Analysis Python
sns.pairplot(data=[1], hue=[2]) plt.show()
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'class' instead of 'species' for hue
Passing the dataset as a string instead of variable
✗ Incorrect
The dataset variable is data and the column to color by is 'species'.
5fill in blank
hardFill all three blanks to create a pair plot with markers for each species and limited variables.
Data Analysis Python
sns.pairplot(data=[1], vars=[2], hue=[3], markers=['o', 's', '^']) plt.show()
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'variety' instead of 'species' for hue
Passing vars as a string instead of a list
Using an undefined variable instead of data
✗ Incorrect
Use the dataset variable data, select the numeric columns in a list, and color by 'species'.