1

I want to how I can append the data from dataframe to excel cells using python. I am able to do it for csv files. Code for appending data in csv:-

print(yes['we'].to_csv(r'C:/Users/Desktop/yo.txt', header=None, index=None, sep=' ', mode='a'))
Shirohige
  • 243
  • 1
  • 3
  • 14
  • Possible duplicate of [Append existing excel sheet with new dataframe using python pandas](https://stackoverflow.com/questions/38074678/append-existing-excel-sheet-with-new-dataframe-using-python-pandas) – YLJ Jun 23 '17 at 07:23
  • You can do it like in this Answer: https://stackoverflow.com/a/44596841/7414759 – stovfl Jun 23 '17 at 07:27

1 Answers1

0
file_location="C:/Users/Jiang/Desktop/xert.xlsx"
wb = load_workbook(file_location)
ws = wb.get_sheet_by_name('Sheet1')
ws.append([result0, int(result1), int(result2)])
KeepLearning
  • 517
  • 7
  • 10