invenia / Impute.jl

Imputation methods for missing data in julia
https://invenia.github.io/Impute.jl/latest/
Other
76 stars 11 forks source link

FillNA limits for Interpolate, NOCB, LOCF #110

Closed adinhobl closed 3 years ago

adinhobl commented 3 years ago

Hi,

In Pandas DataFrames, their methods for interpolating and fillna have a limit keyword, which essentially cuts the imputing routine short after a certain number of fills.

This is useful if you want to forward fill timeseries data by a "reasonable" amount, but not necessarily to the next point. Is this implemented somewhere else, or would it be useful in this package? Or is there a trivial workaround I haven't thought of. I'm not averse to trying to implement it myself.

Thanks!

rofinn commented 3 years ago

Please take a look at #117 to confirm that it does what you'd like. LOCF and NOCB will fill up-to the limit, but Interpolate will only fill gap_sz <= limit.