How do I edit XLSX spreadsheets with pandas

前端 未结 1 1420
时光取名叫无心
时光取名叫无心 2021-01-27 12:55

How do I edit spreadsheets using pandas, or any other library.

I have a CSV where I do the data reading and some filters, which I intend to save in an XLSX worksheet rea

1条回答
  •  温柔的废话
    2021-01-27 13:10

    In pandas version 0.24 they will be an option for mode='a'; however; right now you will have to:

    writer = pd.ExcelWriter(excel_name, engine='openpyxl')
    writer.book = load_workbook(excel_name)
    df5.to_excel(writer, sheet_name='FullExport', index=False)
    writer.save()
    write.close() # i think close() already runs the save function above
    

    0 讨论(0)
提交回复
热议问题