0
0
Matplotlibdata~10 mins

Why performance matters with big datasets in 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 the matplotlib plotting library.

Matplotlib
import [1] as plt
Drag options to blanks, or click blank then click option'
Aseaborn
Bmatplotlib.pyplot
Cpandas
Dnumpy
Attempts:
3 left
💡 Hint
Common Mistakes
Importing the whole matplotlib instead of pyplot.
Using unrelated libraries like pandas or numpy.
2fill in blank
medium

Complete the code to create a scatter plot of x and y data.

Matplotlib
plt.[1](x, y)
plt.show()
Drag options to blanks, or click blank then click option'
Ascatter
Bbar
Cplot
Dhist
Attempts:
3 left
💡 Hint
Common Mistakes
Using plot which connects points with lines.
Using bar or hist which are for different chart types.
3fill in blank
hard

Fix the error in the code to plot a large dataset efficiently by reducing point size.

Matplotlib
plt.scatter(x, y, s=[1])
plt.show()
Drag options to blanks, or click blank then click option'
A1
B0
C100
D-5
Attempts:
3 left
💡 Hint
Common Mistakes
Using zero or negative sizes which cause errors or no points.
Using large sizes that slow down rendering.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that filters words longer than 5 letters and stores their lengths.

Matplotlib
{word: [1] for word in words if len(word) [2] 5}
Drag options to blanks, or click blank then click option'
Alen(word)
Bword
C>
D<=
Attempts:
3 left
💡 Hint
Common Mistakes
Using the word itself as the value instead of its length.
Using wrong comparison operators.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that stores uppercase words as keys, their counts as values, only if count is greater than 1.

Matplotlib
{ [1]: [2] for word, count in word_counts.items() if count [3] 1 }
Drag options to blanks, or click blank then click option'
Aword.upper()
Bcount
C>
Dword
Attempts:
3 left
💡 Hint
Common Mistakes
Using original words instead of uppercase.
Using wrong comparison operators or values.