Skip to content

limit keyword for interpolate #1892

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

Closed
changhiskhan opened this issue Sep 11, 2012 · 5 comments
Closed

limit keyword for interpolate #1892

changhiskhan opened this issue Sep 11, 2012 · 5 comments
Labels
Enhancement Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate Numeric Operations Arithmetic, Comparison, and Logical operations
Milestone

Comments

@changhiskhan
Copy link
Contributor

need to also define whether limit is relative to most recent non-na or immediate next non-na

based on SO discussion in http://stackoverflow.com/questions/12372899/bug-in-pandas-series-dataframe-fillna-limit

@rhkarls
Copy link
Contributor

rhkarls commented Sep 12, 2012

I think this is a much needed feature of interpolation. I would also suggest that it works (or as an option better) slightly different from the 'limit' for fillna. Say limit=2, if there is a NaN gap of 2 it would be completely filled with interpolated values. If there is a NaN gap of 4 nothing is filled, which is different from the fillna limit where the two first entries would be filled when using forward filling. This is very applicable for time series where it is often valid to interpolate between small gaps, while larger gaps should not be filled.

@jreback
Copy link
Contributor

jreback commented Oct 9, 2013

closed via #4915

@jreback jreback closed this as completed Oct 9, 2013
@naifrec
Copy link

naifrec commented May 23, 2017

I am sorry to revive an old issue, but I did not understand how PR #4915 solved this issue. The limit kwags still works like fillna, which does not make so much sense when applied to time series. Would be very nice to have the feature described by @rhkarls imo.

@jreback
Copy link
Contributor

jreback commented May 23, 2017

@naifrec commenting on an old issue like this won't do much, you might want to see: #16284

or give a specific example of what you are looking (in a new issue)

@naifrec
Copy link

naifrec commented May 23, 2017

@jreback alright not so used to contribute to frameworks on github. I made a function that does exactly what rhkaris describes so I'll comment and describe the feature on the issue you referenced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate Numeric Operations Arithmetic, Comparison, and Logical operations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants