How to convert a numeric column in pandas to a string with comma separators?
18,146
You can format your column by doing this:
df['new_column_name'] = df['column_name'].map('{:,.2f}'.format)
But keep in mind that the new column will contain strings, not floats.
Author by
Kay
Updated on June 05, 2022Comments
-
Kay almost 2 years
I want to convert a column that has values like 1234567.89 to 1,234,567.89. Can someone help me with this.