Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend interpolate_over_time to bfill, ffill, nearest and constant functionality #326

Open
sfmig opened this issue Oct 18, 2024 · 0 comments
Labels
enhancement New optional feature

Comments

@sfmig
Copy link
Contributor

sfmig commented Oct 18, 2024

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
\

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New optional feature
Projects
Status: 🤔 Triage
Development

No branches or pull requests

1 participant