airbornegeo.interpolate_missing#
- interpolate_missing(data, *, to_interp, interp_on, method='cubic', extrapolate=False, fill_value=None, groupby_column=None, progressbar=True)[source]#
Interpolate NaN’s in a dataframe’s “to_interp” column, based on values from the “interp_on” column. Falls back through method -> ‘linear’ -> ‘nearest’ if the requested method can’t be fit (insufficient points, or an actual fit failure), trying each in turn rather than deciding once from point count alone.
To interpolate multiple columns, call this function once per column.
- method:
‘linear’, ‘nearest’, ‘nearest-up’, ‘zero’, ‘slinear’, ‘quadratic’, ‘cubic’, ‘previous’, ‘next’
- Parameters:
data (
DataFrame) – Dataframe containing the data to interpolateto_interp (
str) – Column to interpolateinterp_on (
str) – Column to interpolate onmethod (
str) – Interpolation method to use, by default “cubic”extrapolate (
bool) – Whether to extrapolate beyond the data range, by default Falsefill_value (
tuple[float,float] |str|None) – Value to use for filling gaps, by default Nonegroupby_column (
str|None) – Column name to group by before interpolating, by default Noneprogressbar (
bool) – Show progress bar for each group, by default True
- Returns:
Dataframe with interpolated column
- Return type: