enum class fill_policy : unsigned char {
value = 1,
fill_forward = 2,
fill_backward = 3,
linear_interpolate = 4, // Using the index as X coordinate
linear_extrapolate = 5, // Using the index as X coordinate
mid_point = 6, // Mid-point of x and y
};
|
This policy determines how to fill missing values in the DataFrame
value: Fill all the missing values, in a given column, with the given value.
fill_forward: Fill the missing values, in a given column, with the last valid
value before the missing value
fill_backward: Fill the missing values, in a given column, with the first valid
value after the missing value
linear_interpolate:
linear_extrapolate:
Use the index column as X coordinate and the given column as Y coordinate
And do interpolation/extrapolation as follows:
X - X1
Y = Y1 + ----------- * (Y2 - Y1)
X2 - X1
|