Skip to content

Commit 28e24bd

Browse files
1 parent 982c250 commit 28e24bd

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

bisect/44864.py

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# BUG: inconsistency in dtype of replace() #44864
2+
3+
import pandas as pd
4+
5+
print(pd.__version__)
6+
s = pd.Series(["0"])
7+
res1 = s.replace(to_replace="0", value=1, regex=False) # shows int64
8+
print(res1)
9+
res2 = s.replace(to_replace="0", value=1, regex=True) # shows object
10+
print(res2)
11+
12+
assert res2.dtype == "int64"

0 commit comments

Comments
 (0)