When appending to csv, my first line is starting on the existing last line rather than a new line.
I keep searching SO, but I am just finding the basic use of openi
I had a similar problem and after a god bit of searching, I didn't find any simple/elegant solution. The minimal fix that worked for me is:
import pandas as pd with open('foo.csv') as f: f.write('\n') mydf.to_csv('foo.csv', index = False, header = False, mode='a')