0

I just run a python script that writes a dataframe into a csv file. 5 executions of the script (with different arguments) are running at the same time and are writing into the same csv sheet.

I just read the csv file with the pandas read_csv function and realized that some of my data is missing. I had like 2600 1 hour ago and now it is only 1400 rows.

It looks like sth. is going wrong when saving the data frame into the csv..

I just do:

evaluation_df.to_csv('Evaluation_Scen1.csv')

Does anyone know what is going on here?

Mauritius
  • 265
  • 1
  • 8
  • 23
  • 1
    Do you need append data to existing file? Then use `evaluation_df.to_csv('Evaluation_Scen1.csv', mode='a')` – jezrael Dec 14 '21 at 08:50
  • 1
    Thanks for your reply! I wonder why it worked until now. Thousands of rows each appended one by one, but now it does not work anymore.. I will give your solution a try however! Thanks – Mauritius Dec 14 '21 at 08:53

0 Answers0