Skip to content

ENH: Add limit_distance parameter to Series/DataFrame.interpolate - #66548

Open
GalD101 wants to merge 10 commits into
pandas-dev:mainfrom
GalD101:feature/interpolate-limit-distance
Open

ENH: Add limit_distance parameter to Series/DataFrame.interpolate#66548
GalD101 wants to merge 10 commits into
pandas-dev:mainfrom
GalD101:feature/interpolate-limit-distance

Conversation

@GalD101

@GalD101 GalD101 commented Jul 30, 2026

Copy link
Copy Markdown

Closes #66545

Adds a limit_distance parameter to Series.interpolate() and DataFrame.interpolate(). This allows users to restrict interpolation across numerical or time-based gaps that exceed a specified threshold (supporting numeric scalars, duration strings like "5s", and pd.Timedelta objects).

GalD101 added 4 commits July 31, 2026 23:17
…ecks

- Ensure limit_distance positivity check runs before the empty-object early return in interpolate()
- Add type-aware validation in _interp_limit_distance to disallow temporal/non-temporal unit mismatches
- Add unit tests for empty Series and type mismatch validation
…stance validation

- Move limit_distance validation before the empty-object early return in generic.py
- Explicitly reject NaN thresholds in validate_limit_distance
- Add test coverage for empty temporal Series with duration strings and TimedeltaIndex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ENH: Add limit_distance parameter to Series/DataFrame.interpolate

1 participant