Skip to content

Conversation

phofl
Copy link
Member

@phofl phofl commented Sep 1, 2023


def test_interpolate_fill_value(self):
# GH#54920
ser = Series([np.nan, 0, 1, np.nan, 3, np.nan])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a pytest.importorskip("scipy")

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx

@mroeschke mroeschke added Bug Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate labels Sep 1, 2023
@@ -8180,7 +8180,7 @@ def interpolate(
stacklevel=find_stack_level(),
)

if "fill_value" in kwargs:
if method in fillna_methods and "fill_value" in kwargs:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@phofl Would it make sense to adapt the Error message below to mention that fill_value is not valid for the fillna-methods?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I updated the message

@jbrockmendel
Copy link
Member

Is this a good time to remove the keyword from EA.interpolate?

@phofl
Copy link
Member Author

phofl commented Sep 2, 2023

There is not a straightforward equivalent for no fill_value, but not a string opinion

@phofl phofl added this to the 2.1.1 milestone Sep 2, 2023
@mroeschke mroeschke merged commit e1ec244 into pandas-dev:main Sep 5, 2023
@mroeschke
Copy link
Member

Thanks @phofl

meeseeksmachine pushed a commit to meeseeksmachine/pandas that referenced this pull request Sep 5, 2023
@phofl phofl deleted the 54920 branch September 5, 2023 20:05
mroeschke pushed a commit that referenced this pull request Sep 5, 2023
…_value is given) (#55017)

Backport PR #54927: REGR: interpolate raising if fill_value is given

Co-authored-by: Patrick Hoefler <61934744+phofl@users.noreply.github.com>
mroeschke added a commit to mroeschke/pandas that referenced this pull request Sep 11, 2023
* REGR: interpolate raising if fill_value is given

* Update test and message

* Update pandas/core/generic.py

---------

Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: 'fill_value' is not a valid keyword for Series.interpolate
4 participants