Assuming that I have a pandas dataframe and I want to add thousand separators to all the numbers (integer and float), what is an easy and quick way to do it?
Use Series.map or Series.apply with this solutions:
df['col'] = df['col'].map('{:,}'.format) df['col'] = df['col'].map(lambda x: f'{x:,}')
df['col'] = df['col'].apply('{:,}'.format) df['col'] = df['col'].apply(lambda x: f'{x:,}')