BUG: Change in behavior of replace with integer series and float to_replace #40371
Closed
2 of 3 tasks
Labels
Milestone
Code Sample, a copy-pastable example
Problem description
As of version 1.1.5 (and earlier), the code snippet above yielded
pd.Series([0])
(i.e. the replacement took place). As of version 1.2.0 (and later), the code snippet above yieldspd.Series([1])
(i.e. the replacement does not take place). In both versions, the replacement takes place if we pass either an integer array (np.array([1])
) or a list ([1.]
) toreplace
instead of a float array (np.array([1.])
). Is this change in behavior intentional?Output of
pd.show_versions()
The text was updated successfully, but these errors were encountered: