@@ -1916,32 +1916,24 @@ def _repr_latex_(self):
19161916 ... index=['row 1', 'row 2'],
19171917 ... columns=['col 1', 'col 2'])
19181918 >>> df1.to_excel("output.xlsx")
1919+
1920+ If you want to set engine that can manipulate Excel,
1921+ pass keyword argument named engine. Actually
1922+ engine is automatically chosen by file extension:
1923+
1924+ >>> df1.to_excel('output1.xlsx', engine='xlsxwriter')
19191925
19201926 To specify the sheet name:
19211927
19221928 >>> df1.to_excel("output.xlsx", sheet_name='Sheet_name_1')
1923-
1929+
19241930 If you wish to write to more than one sheet in the workbook, it is
19251931 necessary to specify an ExcelWriter object:
19261932
1927- >>> with ExcelWriter('output.xlsx') as writer:
1933+ >>> with pd. ExcelWriter('output.xlsx') as writer:
19281934 ... df1.to_excel(writer, sheet_name='Sheet_name_1')
19291935 ... df2.to_excel(writer, sheet_name='Sheet_name_2')
19301936
1931- If you want to set engine that can manipulate Excel,
1932- pass keyword argument named engine. Actually
1933- engine is automatically chosen by file extension:
1934-
1935- >>> df1.to_excel('output1.xlsx', engine='xlsxwriter')
1936- >>> with ExcelWriter('output2.xlsx', engine='openpyxl') as writer:
1937- ... df2.to_excel(writer)
1938-
1939- You can set date format or datetime format:
1940-
1941- >>> with ExcelWriter('path_to_file.xlsx',
1942- date_format='YYYY-MM-DD',
1943- datetime_format='YYYY-MM-DD HH:MM:SS') as writer:
1944- ... df.to_excel(writer)
19451937
19461938 """
19471939
0 commit comments