what exactly is the "order"-parameter in pandas interpolation?

what exactly is the order-parameter in pandas interpolation?

it is mentioned in the doc:

‘nearest’, ‘zero’, ‘slinear’, ‘quadratic’, ‘cubic’, ‘spline’, ‘barycentric’, ‘polynomial’: Passed to scipy.interpolate.interp1d. These methods use the numerical values of the index. Both ‘polynomial’ and ‘spline’ require that you also specify an order (int), e.g. df.interpolate(method='polynomial', order=5).

Topic mathematics interpolation parameter pandas python

Category Data Science


The order argument simply refers to the order of the function that is used when interpolating values. As the documentation mentiones, you only need to provide a value for the order argument when you are using either a polynomial or spline for the interpolation. The value then simply refers to the order (or degree) of the polynomial or spline that is used, e.g. a second or third order polynomial. You can find some more info on the documentation of the underlying scipy.interpolate functions that are called, which are interp1d for the polynomial and UnivariateSpline for the spline.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.