fill_nodata

Luo_Suppe2026-08-15

gma.math.prepro.fill_nodata

function fill_nodata(data, nodatas = None, method = "linear", axis = None, **kwargs):

Interpolate missing or abnormal values.

Parameters:

data: list||tuple||Series||DataFrame||array.

Data to be filled.

Optional:

nodatas = float||list. Default None.

Flags missing values that need to be filled. Can be a number (float) or a list of numbers (list).

Note: 1. When nodatas is a list, all values in the list will be interpolated.

2. The original NAN, INF, strings that cannot be converted into numbers and other abnormal values in the data will also be interpolated.

method = str. Default 'linear'.

Interpolation method. Supported methods include: 'index', 'values', 'pad', 'nearest', 'zero', 'slinear', 'quadratic', 'cubic', 'spline', 'barycentric', 'polynomial', 'from_derivatives', 'krogh', 'piecewise_polynomial','pchip', 'akima', 'cubicspline', 'linear'.

axis = int. Default None.

Axis used for data interpolation. By default (None), if the data is less than 3 dimensions, the first dimension is the axis; if the data is higher than 3 dimensions, the penultimate dimension is the axis.

**kwargs. Additional arguments to pass to the interpolation function..

For example: method is 'polynomial' or 'spline', you need to set order (order), the default order is 3.

Returns:

Type: Series||DataFramereturnstheinputtype;list||tuple||arrayreturnsanarray.


Last Updated 8/15/2026, 8:42:21 AM