Interpolation is an important method of discrete function approximation. It can be used to estimate the approximate value of the function at other points through the value of the function at a finite number of points. Unlike fitting, the curve is required to pass all known data.
SciPy
Theinterpolate
module provides many functions for interpolating data, ranging from simple one-dimensional interpolation to complex multi-dimensional interpolation.
1. Interp1d() function
Interpolation of one-dimensional data can be completed by the function interp1d().
Its calling form: interp1d(x, y, kind='linear', …)
2. Demonstrate sine function interpolation
- Obviously, the more interpolation points, the better the image fitting effect.