Python study notes: interpolation of one-dimensional data

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. SciPyThe interpolatemodule 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', …)
Insert picture description here

2. Demonstrate sine function interpolation

Insert picture description here

  • Obviously, the more interpolation points, the better the image fitting effect.

Guess you like

Origin blog.csdn.net/howard2005/article/details/109206813