0
import pandas as pd

read_csv = pd.read_csv('dse.csv')
read_csv.loc['new'] = ['Sunny', 'Programmer']

print(read_csv)

I want to update this new row and save this information in CSV file without losing previous data

Ansh Ansh
  • 63
  • 5

1 Answers1

0

Using df.to_csv's mode argument:

read_csv.to_csv('dse.csv', mode='a', header=False)
Wasif
  • 13,656
  • 3
  • 11
  • 30