Apr-04-2022, 08:42 AM
I am really not familiar with Pandas, never having large amounts of data to process, but this seems to work
pd.options.display.float_format = '{:,.2f}'.format (change the 2 for more decimal places I believe)
pd.options.display.float_format = '{:,.2f}'.format (change the 2 for more decimal places I believe)
import pandas as pd csv_file = '/home/pedro/myPython/pandas/testme.csv' savepath = '/home/pedro/myPython/pandas/' pd.options.display.float_format = '{:,.2f}'.format df = pd.read_csv(csv_file) # get each column columns = ['col1', 'col2', 'col3'] # put your column headers for colnr in columns: mydf = df[colnr] mydf.to_csv(savepath + colnr + '.csv', index=False)