-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
NA - MaskedArraysRelated to pd.NA and nullable extension arraysRelated to pd.NA and nullable extension arraysNeeds TestsUnit test(s) needed to prevent regressionsUnit test(s) needed to prevent regressionsStringsString extension data type and string dataString extension data type and string datagood first issuereplacereplace methodreplace method
Milestone
Description
Code Sample, a copy-pastable example if possible
>>>pd.Series(['A','B']).replace(r'.','C',regex=True)
0 C
1 C
dtype: object
pd.Series(['A','B']).astype('string').replace(r'.','C',regex=True)
0 A
1 B
dtype: string
Problem description
It seems that replace doesn't work with the string type Series.
Why these two codes return different results?
Metadata
Metadata
Assignees
Labels
NA - MaskedArraysRelated to pd.NA and nullable extension arraysRelated to pd.NA and nullable extension arraysNeeds TestsUnit test(s) needed to prevent regressionsUnit test(s) needed to prevent regressionsStringsString extension data type and string dataString extension data type and string datagood first issuereplacereplace methodreplace method