ENH: new interpolate kwarg to skip gaps #16457
Labels
Datetime
Datetime data dtype
Enhancement
Missing-data
np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
Resample
resample method
hey guys! I have the feeling the
limit
kwarg does not behave as you would expect it to when working with time series. To cite @rhkarls in the issue #1892 :So lemme write an example:
Now what I want is to resample and interpolate the time series every 12 hours, but only for the consecutive days, so as not to make too big assumptions on the behavior of the time series for larger time deltas. That is not immediately possible currently, because of how
limit
works. See below, where puttinglimit
of 2 (i.e. limit of a day) means that if two consecutive values are NaN, please do not fill in:To achieve what I want now, I have to use these functions I made:
using these function I now get my desired output:
tldr,
limit
should actually not always do forward filling, but check the length of the NaN gap and not fill in anything if this gap is longer than the limit.Thank you for taking the time to read this, hope I made myself clear.
The text was updated successfully, but these errors were encountered: