Numeric columns have no ,, so converting to strings is not necessary, only use DataFrame.replace with regex=True for substrings replacement:

df = df.replace(',','', regex=True)

Or:

df.replace(',','', regex=True, inplace=True)

And last convert strings columns to numeric, thank you @anki_91:

c = df.select_dtypes(object).columns
df[c] = df[c].apply(pd.to_numeric,errors='coerce')
Answer from jezrael on Stack Overflow
Discussions

Trying to remove commas and dollars signs with Pandas in Python - Stack Overflow
Tring to remove the commas and dollars signs from the columns. But when I do, the table prints them out and still has them in there. Is there a different way to remove the commans and dollars signs using a pandas function. More on stackoverflow.com
🌐 stackoverflow.com
python - Remove comma only from number separators (regular expression grouping) - Stack Overflow
I have a column of alpha-numeric string in pandas dataframe. The goal is to only remove comma from number separators. For example: Hello, world! -> Hello, world! but Warhammer 40,000 -> War... More on stackoverflow.com
🌐 stackoverflow.com
Removing number comma seperators in csv file
Pandas will recognize the comma as thousands separators; there is a optional argument for that, use thousands=",": >>> inventory_mock_file_contents = """"Part No","Date","Value date","Account","Description","Amount","Quantity" ... "123,456","05/12/2019","05/12/2019","12,345","Payment 04/12/2019 21:23 to:","6,00","56" ... "123,456","05/11/2019","05/12/2019","5,536","Payment 04/11/2019 21:51 to:","10,00","677" ... "123,458","05/10/2019","05/12/2019","100","Payment 04/10/2019 22:55 to:","16,00","2" ... """ >>> df = pd.read_csv(io.StringIO(inventory_mock_file_contents), thousands=',') >>> df Part No Date ... Amount Quantity 0 123456 05/12/2019 ... 600 56 1 123456 05/11/2019 ... 1000 677 2 123458 05/10/2019 ... 1600 2 [3 rows x 7 columns] >>> df.dtypes Part No int64 Date object Value date object Account int64 Description object Amount int64 Quantity int64 dtype: object >>> More on reddit.com
🌐 r/learnpython
5
1
May 5, 2021
ENH: pd.to_numeric() should handle stripping commas and % symbols as an additional option for error handling
EnhancementNeeds TriageIssue that ... by a pandas team member ... commas and % symbols are pretty common in tabular data but pdl.to_numeric() doesnt handle number strings liike 1,234 or 10%. I wish there were addtional options for errors such as 'coerce_after_cleaning' so a single line of code can handle commonly used cleaning such as removing special characters from number ... More on github.com
🌐 github.com
1
September 29, 2023
🌐
YouTube
youtube.com › watch
How to Change Datatype and Remove Commas from Numbers in Pandas - YouTube
Learn how to effectively remove commas from strings in Pandas and convert them to numerical datatype for analysis. Step-by-step tips included!---This video i...
Published   March 20, 2025
Views   0
🌐
YouTube
youtube.com › watch
How to remove commas from ALL the column in pandas at once
Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.
Published   February 10, 2022
🌐
Saturn Cloud
saturncloud.io › blog › how-to-remove-characters-from-a-pandas-column-a-data-scientists-guide
How to Remove Characters from a Pandas Column A Data Scientists Guide | Saturn Cloud Blog
May 1, 2026 - In this example, we created a sample DataFrame with a column named ‘phone’ that contains phone numbers in a specific format. We then used regex to extract the digits from the phone column and concatenate them into a single string. If the above methods do not meet your requirements, you can create a custom function to remove characters from a pandas column.
Find elsewhere
🌐
Reddit
reddit.com › r/learnpython › removing number comma seperators in csv file
r/learnpython on Reddit: Removing number comma seperators in csv file
May 5, 2021 -

Hey guys, I have a csv file with any number greater than 999 being listed as a string in the form “1,000”. including the quotes. I’m trying to get rid of these commas so I can turn them into an integer, however I’m unsure how to do it without touching the other commas used to seperate the values. Any suggestions? So far I have thought this out but it’s not quite right.

‘’’ import pandas as pd df = pd.read_csv(‘..., sep = “, “)

firstline = True

if firstline: firstline = False else: for line in df: if “,” in line[3]: #the column with the values line[3].replace(“,”, “ “)

‘’’

Sorry for the formatting I am on phone. Thanks for the help :)

🌐
GitHub
github.com › pandas-dev › pandas › issues › 55329
ENH: pd.to_numeric() should handle stripping commas and % symbols as an additional option for error handling · Issue #55329 · pandas-dev/pandas
September 29, 2023 - coerce_numeric = errors not in ("ignore", "raise") # existing line in numeric.py file of pandas source code # new code after the above existing line to pre-process when appropriate value for errors is passed if errors == "coerce_after_cleaning": coerce_numeric = True errors = "coerce" # Step 1: Pre-processing loop to handle '12,345.1' and '1.234%' for i in range(values.size): val = values[i] if isinstance(val, str): # Remove commas and % signs val = val.replace(',', '').replace('%','') # maybe convert percentages to fractions - if so uncomment the next lines # and drop the 2nd replace in the line above #if '%' in val: # val = str(float(val.replace('%', '')) / 100) values[i] = val # end of cleaning
Author   pandas-dev
🌐
Stack Abuse
stackabuse.com › how-to-remove-commas-from-a-string-in-python
How to Remove Commas from a String in Python
June 12, 2023 - Python's built-in string methods translate() and maketrans() offer another way to remove characters from a string. The maketrans() method returns a translation table that can be used with the translate() method to replace specified characters. Let's use the same string as before as an illustration: ... This method takes two arguments - the list of characters to be replaced and the list of characters to replace them with. Here, we're replacing commas with nothing, hence the empty string as the second argument.
🌐
Medium
medium.com › the-innovation › basic-steps-when-cleaning-a-data-set-using-pandas-3576e716173d
Basic Steps When Cleaning a Data Set Using Pandas | by Will Newton | Medium
August 3, 2020 - This method requires the first value to be a tuple where the first element of the tuple is what is to be removed and the second element is what will replace it. cols_to_clean = ['production_budget', 'domestic_gross', 'worldwide_gross'] for col in cols_to_clean: df[col] = df[col].map(lambda x: x.replace('$','')) ... Looks like it worked great! Let’s move on to the commas. As we saw in a previous example, some of the numeric values in the last 3 columns were just the number 0.
🌐
Saturn Cloud
saturncloud.io › blog › what-is-the-best-way-to-remove-characters-from-a-string-in-pandas
What Is the Best Way to Remove Characters from a String in Pandas | Saturn Cloud Blog
November 20, 2023 - In this case, we replace commas with an empty string (''). Note that the str.replace() method is case-sensitive. If you want to remove a character regardless of its case, you can use a regular expression with the ’re' module.
🌐
Mark Needham
markhneedham.com › blog › 2021 › 04 › 11 › pandas-format-dataframe-numbers-commas-decimals
Pandas - Format DataFrame numbers with commas and control decimal places | Mark Needham
April 11, 2021 - 204 """ --> 205 return self.render() 206 207 @doc( ~/.local/share/virtualenvs/covid-vaccines-xEbcGJTy/lib/python3.8/site-packages/pandas/io/formats/style.py in render(self, **kwargs) 619 self._compute() 620 # TODO: namespace all the pandas keys --> 621 d = self._translate() 622 # filter out empty styles, every cell will have a class 623 # but the list of props may just be [['', '']]. ~/.local/share/virtualenvs/covid-vaccines-xEbcGJTy/lib/python3.8/site-packages/pandas/io/formats/style.py in _translate(self) 403 "value": value, 404 "class": " ".join(cs), --> 405 "display_value": formatter(value
🌐
Quora
quora.com › How-do-I-remove-the-commas-and-currency-symbols-while-webscraping-data-in-Python-so-that-the-data-can-be-used-as-an-integer-float
How to remove the commas and currency symbols while webscraping data in Python so that the data can be used as an integer/float - Quora
How do I remove the commas and currency symbols while webscraping data in Python so that the data can be used as an integer/float? ... When webscraping you’ll commonly get numbers as strings containing currency symbols, commas, whitespace, and sometimes parentheses or other locale markers. Convert those safely to int/float by normalizing the string first, then parsing. Below are robust, practical patterns and examples using plain Python, pandas...
🌐
Quora
quora.com › How-do-I-remove-extra-commas-from-CSV-using-Python
How to remove extra commas from CSV using Python - Quora
Answer (1 of 2): Extra commas in csv file are nothing but missing value, if the commas are extreme right you can just use rstrip () on read csv file. If in middle I think this below code should work. [code]import csv csv_in = file('test.csv', 'rU') csv_file = csv.reader(csv_in) for k in csv_f...