-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
BUG: Replace on Series/DataFrame stops replacing after first NA #57865
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
Conversation
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
…ndas into replace_mask_bug_regex
Thanks @asishm |
…as-dev#57865) * update test for GH#56599 * bug: ser/df.replace only replaces first occurence with NAs * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add whatsnew * fmt fix --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Along with other string type fixes, I think it'd be good to backport this to 2.3.x. Any objection @mroeschke @jorisvandenbossche? |
No objection from me |
@meeseeksdev backport to 2.3.x |
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon! Remember to remove the If these instructions are inaccurate, feel free to suggest an improvement. |
…replacing after first NA
StringDtype
column with NA values stops replacing after first NA #56599doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.The issue was the line
a = a[mask]
was triggered only forndarray
and doesn't hit whendtype='string'
, but thenp.place
logic applied as long as the result was anndarray
.The old behavior had things like (depending on the number and location of NAs)