-
-
Notifications
You must be signed in to change notification settings - Fork 19.1k
REGR: Fix regression RecursionError when replacing numeric scalar with None #48234
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
Changes from 3 commits
205c0f0
18b4b92
1d1e98c
2402196
a71367d
2735ec2
796b870
42b11cb
077cd93
f1cf6e8
d7c7a9e
0eb2b08
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1496,6 +1496,14 @@ def test_replace_list_with_mixed_type( | |
result = obj.replace(box(to_replace), value) | ||
tm.assert_equal(result, expected) | ||
|
||
@pytest.mark.parametrize("val", [2, np.nan, 2.0]) | ||
def test_replace_value_none_dtype_numeric(self, val): | ||
# GH#48231 | ||
df = DataFrame({"a": [1, val]}) | ||
result = df.replace(val, None) | ||
expected = DataFrame({"a": [1, np.nan]}) | ||
|
||
tm.assert_frame_equal(result, expected) | ||
|
||
|
||
class TestDataFrameReplaceRegex: | ||
@pytest.mark.parametrize( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guess we should move to 1.5.2 now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done