Skip to content

BUG: replace int64 dtype with bool coerces to int64 #9113

@sinhrks

Description

@sinhrks
# NG
s = pd.Series([1, 2, 3])
s.replace(2, True)
#0    1
#1    1
#2    3
# dtype: int64

If target has object dtype, it works.

s = pd.Series(['x', 2, 3])
s.replace(2, True)
#0       x
#1    True
#2       3
# dtype: object

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions