Skip to content

ENH: .interpolate() with EA Dtypes #50950

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
jbrockmendel opened this issue Jan 24, 2023 · 3 comments · Fixed by #53659
Closed

ENH: .interpolate() with EA Dtypes #50950

jbrockmendel opened this issue Jan 24, 2023 · 3 comments · Fixed by #53659
Labels
Enhancement ExtensionArray Extending pandas with custom dtypes or arrays. NA - MaskedArrays Related to pd.NA and nullable extension arrays

Comments

@jbrockmendel
Copy link
Member

jbrockmendel commented Jan 24, 2023

ser = pd.Series([1, 2, None, 4], dtype="Int64")

>>> ser.interpolate()
[...]
ValueError: Invalid fill method. Expecting pad (ffill) or backfill (bfill). Got linear

EABackedBlock.interpolate dispatches to EA.fillna, which doesn't handle method="linear". Getting this right probably will require implementing something new at the EA level.

Expected Behavior

pd.Series([1, 2, 3, 4])

@jbrockmendel jbrockmendel added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Jan 24, 2023
@topper-123
Copy link
Contributor

Yeah , I think this should be implemented.

@topper-123 topper-123 added Enhancement NA - MaskedArrays Related to pd.NA and nullable extension arrays ExtensionArray Extending pandas with custom dtypes or arrays. and removed Bug Needs Triage Issue that has not been reviewed by a pandas team member labels May 6, 2023
@jbrockmendel
Copy link
Member Author

Just a thought: the logic needed to implement interpolate for arrow ChunkedArray is similar to the logic that would be needed to implement DataFrame.interpolate with axis=1 without transposing.

@jbrockmendel
Copy link
Member Author

@jorisvandenbossche any idea if pyarrow has/plans anything analogous to the numpy/scipy interpolation functions we call from core.missing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement ExtensionArray Extending pandas with custom dtypes or arrays. NA - MaskedArrays Related to pd.NA and nullable extension arrays
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants