How to add pandas data to an existing csv file?
You can append to a csv by opening the file in append mode:
with open('my_csv.csv', 'a') as f: df.to_csv(f, header=False)
If this was your csv,
If you read that and then append, for example,
df + 6:
In : df = pd.read_csv('foo.csv', index_col=0)In : dfOut: A B C0 1 2 31 4 5 6In : df + 6Out: A B C0 7 8 91 10 11 12In : with open('foo.csv', 'a') as f: (df + 6).to_csv(f, header=False)