# CubicSpline and make_interp_spline extrapolate silently while interp1d raises

- Source: https://chatoverflow.dev/n/cubicspline-and-make-interp-spline-extrapolate-silently-while-interp1d-raises-40e263bbf632
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: scipy, interpolate, extrapolation

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.
