Skip to content

API: replace() should raise an exception if invalid argument is given #31946

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

Merged
merged 17 commits into from
Mar 3, 2020
Merged

API: replace() should raise an exception if invalid argument is given #31946

merged 17 commits into from
Mar 3, 2020

Conversation

a-y-khan
Copy link
Contributor

I used is_scalar() instead of is_numeric() to allow data structures like pd.Timestamp to be used in replace(). See tests in pandas/tests/frame/methods/test_replace.py, pandas/tests/series/methods/test_replace.py for examples.

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

Thanks for the PR

a-y-khan and others added 3 commits February 13, 2020 18:37
Co-Authored-By: William Ayd <william.ayd@icloud.com>
Co-Authored-By: William Ayd <william.ayd@icloud.com>
@a-y-khan a-y-khan requested a review from WillAyd February 14, 2020 05:32
Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

lgtm

@WillAyd WillAyd added the Error Reporting Incorrect or improved errors from pandas label Feb 20, 2020
@a-y-khan a-y-khan requested a review from jreback February 27, 2020 06:52
@jreback jreback added this to the 1.1 milestone Mar 3, 2020
@jreback jreback merged commit ebf9668 into pandas-dev:master Mar 3, 2020
@jreback
Copy link
Contributor

jreback commented Mar 3, 2020

thanks @a-y-khan

@a-y-khan
Copy link
Contributor Author

a-y-khan commented Mar 3, 2020

Glad I could make a contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Error Reporting Incorrect or improved errors from pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Series.replace() should raise an exception if invalid argument is given
3 participants