Complete the code to import the parametric spline function from scipy.
from scipy.interpolate import [1]
The splprep function is used for parametric spline interpolation in scipy.
Complete the code to create a parametric spline representation of points x and y.
tck, u = splprep([x, y], s=[1])Setting s=0 forces the spline to pass through all points exactly.
Fix the error in the code to evaluate the spline at new parameter values u_new.
x_new, y_new = splev([1], tck)tck as the first argument instead of the parameter values.The splev function evaluates the spline at the new parameter values u_new.
Fill both blanks to create a smooth parametric curve and evaluate it at 100 points.
tck, u = splprep([x, y], s=[1]) u_new = np.linspace(0, 1, [2])
Use s=0 for exact fit and 100 points for smooth evaluation.
Fill all three blanks to create a parametric spline, evaluate it, and plot the smooth curve.
tck, u = splprep([x, y], s=[1]) u_new = np.linspace(0, 1, [2]) x_new, y_new = splev([3], tck) plt.plot(x_new, y_new) plt.show()
Set smoothing to zero for exact fit, evaluate at 100 points, and use u_new for evaluation.