-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
BugRegressionFunctionality that used to work in a prior pandas versionFunctionality that used to work in a prior pandas versionStringsString extension data type and string dataString extension data type and string data
Milestone
Description
The latest version (0.24.1) does not replace comma separator, but 0.23.4 does.
import pandas as pd
df = pd.DataFrame({'one': ["1,000", "2,000"], 'two': ["3,000", "4,000"]})
df = df.replace({',': ''}, regex=True)
print(pd.__version__)
print(df)
0.23.4
one two
0 1000 3000
1 2000 4000
0.24.1
one two
0 1,000 3,000
1 2,000 4,000
If other characters are used with a comma, it works normally
df = df.replace({'1,': ''}, regex=True)
one two
0 000 3,000
1 2,000 4,000
Metadata
Metadata
Assignees
Labels
BugRegressionFunctionality that used to work in a prior pandas versionFunctionality that used to work in a prior pandas versionStringsString extension data type and string dataString extension data type and string data