0
0
Matplotlibdata~10 mins

When to use Seaborn vs Matplotlib - Interactive Practice

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

Complete the code to import the Matplotlib plotting library.

Matplotlib
import [1] as plt
Drag options to blanks, or click blank then click option'
Apandas
Bseaborn
Cmatplotlib.pyplot
Dnumpy
Attempts:
3 left
💡 Hint
Common Mistakes
Importing seaborn instead of matplotlib.pyplot
Importing numpy or pandas which are not plotting libraries
2fill in blank
medium

Complete the code to create a simple line plot using Matplotlib.

Matplotlib
plt.[1]([1, 2, 3], [4, 5, 6])
Drag options to blanks, or click blank then click option'
Aplot
Bhist
Cscatter
Dbar
Attempts:
3 left
💡 Hint
Common Mistakes
Using scatter which creates scatter plots, not line plots
Using hist which creates histograms
Using bar which creates bar charts
3fill in blank
hard

Fix the error in the code to create a Seaborn scatter plot.

Matplotlib
sns.[1](data=df, x='age', y='income')
Drag options to blanks, or click blank then click option'
Ascatterplot
Blineplot
Chistplot
Dbarplot
Attempts:
3 left
💡 Hint
Common Mistakes
Using lineplot which creates line charts
Using histplot which creates histograms
Using barplot which creates bar charts
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that filters words longer than 3 letters.

Matplotlib
{word: [1] for word in words if len(word) [2] 3}
Drag options to blanks, or click blank then click option'
Alen(word)
B>
C<
Dword
Attempts:
3 left
💡 Hint
Common Mistakes
Using the word itself as value instead of its length
Using less than symbol which filters shorter words
5fill in blank
hard

Fill all three blanks to create a dictionary of uppercase keys and values filtered by positive values.

Matplotlib
result = [1]: [2] for k, v in data.items() if v [3] 0}
Drag options to blanks, or click blank then click option'
Ak.upper()
Bv
C>
Dk
Attempts:
3 left
💡 Hint
Common Mistakes
Using original keys instead of uppercase
Filtering values less than zero
Swapping keys and values