Df.to_csv append new values but why at csv file the value become scientific

Hello Good Day to All…I have script to append values to existing csv file. When checking the time stamp values become scientific. I have tried several format but it does not change.
I want to display number with no scientific formay…Please help on this…thanks

image

Here is my code

xc_df = pd.DataFrame(xc_log_ls,
                           columns=["Lot", "Wafer", "TestMode", "TimeStamp", "TestProg", "Tester", "DateTimeLog", "XYCoor", "Result"])
if os.path.isfile("xclog.csv"):
    xc_df.to_csv("xclog.csv", float_format='%f', index=False, mode="a", header=False)

It’s the way that your spreadsheet app is formatting the number.

If you use a format code of 0, you’ll see the number as 20221229185735.

1 Like

Hello Rob, how to include code 0 to the script? thanks

To do that, the file will no longer be a CSV file; it’ll be a .xls, or a .ods or some-such.

1 Like

Ok so with CSV cannot do anything already…thanks

You’re welcome.

You don’t have a view a CSV file with a spreadsheet app, but (as you can see) it can make the columns easier to see, but the trade off is that the SS will display the data in a ‘default’ (to the app) way.