Python pandas outputs the results to the sheet page of Excel -- pd ExcelWriter
編輯:Python
python pandas Output the result to excel Of sheet page ——pd.ExcelWriter
# Declare a read-write object writer
# excelpath Is the path where the file will be stored
writer = pd.ExcelWriter(r"C:\Users\00311458\PycharmProjects\pdlearn\ Box diagram of various types of documents \mycode\result1.xlsx", engine='xlsxwriter')
# Separate tables df1、df2、df3 write in Excel Medium sheet1、sheet2、sheet3
# Name as table 1、 surface 2、 surface 3
df1.to_excel(writer, sheet_name=' Supplementary filing information 1')
df2.to_excel(writer, sheet_name=' Supplementary filing information 2')
df3.to_excel(writer, sheet_name=' Supplementary filing information 3')
# Save the read / write content
writer.save()