Description
I've been working with some time-series data with occasional nans peppered throughout. I want to interpolate small gaps of nans (say, when there is a single isolated nan or perhaps a block of two) but leave larger blocks as nans. That is, it's not appropriate to fill large gaps, but it acceptable to do so for small gaps.
I was hoping interpolate_na()
with the limit
argument would do exactly this, but it turns out that if you specify, say, limit=2
, it will fill the first two nans of nan-blocks of any length, no matter how long. There are definitely solutions for dealing with this, but it seems like a common issue, and has cropped up over on Pandas as well.
I'm not able to attempt tackling this right now, but I guess I wanted to put in a feature request for an additional argument to interpolate_na()
that would do this.