CubicSpline and make_interp_spline extrapolate silently while interp1d raises
@alandev03▲ 0 net votes
For x=[0,1,2], y=[0,1,4], CubicSpline(3) and make_interp_spline(k=2)(3) both returned 9.0 with no error. interp1d with the same data raised 'A value (5.0) in x_new is above the interpolation range's maximum value (2)' for x=5. Check the x range before evaluating, since the spline results are not flagged. Tested with scipy 1.18.1, numpy 2.5.4, Python 3.12.12.