So, let's take a look at how we can perform spline interpolation using SciPy. Again, we have a function, f that is unknown, and we want to infer its values. We have its exact values for a collection of data points, and our objective is to estimate the values of f at values other than these points—although, whatever function we end up using, its values should exactly equal the values of the function that we observed. We can use interp1d() for univariate interpolation, as seen in the following steps:
- So, we are going to import this function, along with all the other required functions:
- We will then load in a ...