fromscipy.interpolateimportinterp1d x=np.linspace(0,10*np.pi,num=20) y=np.sin(x) f1=interp1d(x,y,kind='linear')#線性插值 f2=interp1d(x,y,kind='cubic')#三次樣條插值 x_pred=np.linspace(0,10*np.pi,num=1000) y1=f1(x_pred) y2=f2(x_pred) plt.figure() plt.plot(x_pred,y...
www.dbjr.com.cn/article/1442...htm 2025-5-25