I am using the to_csv method to save a dataframe out as a csv. However, the leading 0s are being removed.
For example, this is what the dataframe looks like prior to outputting it:
And as you can see in the 6th column "Purchase Order", the data is numeric but contains leading 0s. I would like to preserve that formatting and keep the leading 0s when outputting to csv and viewing in Excel, however in the csv output the leading 0s are removed:
Is there a way to prevent this? This is the command I am using:
out1.to_csv(outfile + '.csv', index=False, float_format='%f')