All the data I crunch needs to be reported with comma as thousands separator. I'm only interested in values with comma as thousands separator after the data is written to a .csv file. Internally within my pandas dataframe, I want to keep them as int or float.
floats
I can output the floats to zero decimal with:
df.to_csv('c:\Awesome\Groovy.csv', float_format = '%.0f')
but whenever I try to put a comma in the float it doesn't work.
df.to_csv('c:\Awesome\Groovy.csv', float_format = ':,.0f') ## WRONG
df.to_csv('c:\Awesome\Groovy.csv', float_format = {:,.0f}'.format) ## WRONG
ints
And my plan for the ints, is first to convert them to float in the dataframe and then format them with the .to_csv function. Any thoughts?