Complete the code to import the 3D plotting toolkit from matplotlib.
from mpl_toolkits.mplot3d import [1]
The 3D plotting toolkit in matplotlib is called Axes3D. Importing it allows us to create 3D plots.
Complete the code to create a 3D subplot in matplotlib.
fig = plt.figure() ax = fig.add_subplot(111, projection=[1])
To create a 3D subplot, the projection argument must be set to '3d'.
Fix the error in the code to plot a 3D scatter plot with x, y, z data.
ax.scatter([1], y, z)The variable x must be passed exactly as it is to the scatter function to plot the x-coordinates.
Fill both blanks to create a dictionary comprehension that maps each word to its length if the length is greater than 3.
{word: [1] for word in words if [2]The dictionary comprehension maps each word to its length using len(word). The condition filters words with length greater than 3 using len(word) > 3.
Fill all three blanks to create a dictionary comprehension that maps uppercase words to their values if the value is greater than 0.
{ [1]: [2] for k, v in data.items() if [3] }k.lower() instead of uppercase.k > 0 which compares string to number.The dictionary comprehension maps the uppercase version of the key k.upper() to its value v, filtering only those pairs where the value is greater than zero v > 0.