I have a large dataframe with ~450 columns. I need to export it to csv, and for that I use the next command:
df.to_csv('output.csv', sep='\t', header=False, index=False, na_rep='null')
The resulting file is missing several of the trailing columns. I tried to update pandas display options, but that didn't solve the problem:
pd.set_option('display.max_columns', None)
pd.set_option('display.max_colwidth', -1)
pd.set_option('display.width', None)
Any help is appreciated.
Background: I need to export data from one DB table to the other, adding one more column on the fly. I export data to csv, create a dataframe from it, add a column, and then need to export it to csv again to import into the resulting table.