Extend interpolate_over_time
to bfill
, ffill
, nearest
and constant
functionality
#326
Labels
enhancement
New optional feature
Is your feature request related to a problem? Please describe.
We think it would be useful to extend the interpolation over time to some common data imputation methods:
bfill
: fill NaN values by propagating values backward (i.e., replace invalid values with the next valid one).ffill
: fill NaN values by propagating values forward (i.e., replace invalid values with the last valid one).nearest
: replace invalid values with the nearest valid one.constant
: replace invalid values with a constant value.Describe the solution you'd like
We could wrap
xarray
's reindexing (see example from the docs here) or directly its bfill, ffill ... functions. We would need to check carefully how they are different.The value in adding this wrapper function would be that we "fix" the time axis as the interpolation axis (similar to the value added by wrapping xarray's
interpolate_na
).Describe alternatives you've considered
\
Additional context
\
The text was updated successfully, but these errors were encountered: