Complete the code to import the 3D plotting toolkit from matplotlib.
from mpl_toolkits.mplot3d import [1]
The Axes3D module is used to create 3D plots in matplotlib.
Complete the code to create a 3D scatter plot using matplotlib.
ax = fig.add_subplot(111, projection=[1]) ax.scatter(x, y, z)
The projection='3d' argument tells matplotlib to create a 3D plot.
Fix the error in the code to correctly set axis labels for a 3D plot.
ax.set_xlabel('X axis') ax.set_ylabel('Y axis') ax.[1]('Z axis')
The correct method to label the Z axis in a 3D plot is set_zlabel.
Fill both blanks to create a dictionary comprehension that filters points with z > 0 and squares x values.
filtered_points = {x: x[1]2 for x, z in points.items() if z [2] 0}We square x using **2 and filter points where z is greater than 0 using >.
Fill all three blanks to create a dictionary comprehension that converts keys to uppercase, keeps values, and filters values > 10.
result = [1]: [2] for k, v in data.items() if v [3] 10}
We convert keys to uppercase with k.upper(), keep values as v, and filter values greater than 10 with >.