@@ -831,6 +831,19 @@ class ExcelWriter(object):
831
831
832
832
Examples
833
833
--------
834
+ Using ExcelWriter, some settings can be added.
835
+
836
+ Default usage.
837
+
838
+ >>> with ExcelWriter('path_to_file.xlsx') as writer:
839
+ ... df.to_excel(writer)
840
+
841
+ If you want to set engine that can manipulate Excel,
842
+ pass keyword argument named engine. Actually
843
+ engine is automatically chosen by file extension.
844
+
845
+ >>> with ExcelWriter('path_to_file.xlsx', engine='openpyxl') as writer:
846
+ ... df.to_excel(writer)
834
847
835
848
In order to write separate DataFrames to separate sheets
836
849
in a single Excel file, one can pass an ExcelWriter.
@@ -839,6 +852,21 @@ class ExcelWriter(object):
839
852
... df1.to_excel(writer, sheet_name='Sheet1')
840
853
... df2.to_excel(writer, sheet_name='Sheet2')
841
854
855
+ You can set date format or datetime format
856
+
857
+ >>> with ExcelWriter('path_to_file.xlsx',
858
+ date_format='YYYY-MM-DD',
859
+ datetime_format='YYYY-MM-DD HH:MM:SS') as writer:
860
+ ... df.to_excel(writer)
861
+
862
+ It also supports append mode.
863
+
864
+ >>> with ExcelWriter('path_to_file.xlsx', mode='a') as writer:
865
+ ... df.to_excel(writer)
866
+
867
+ .. versionadded:: 0.24.0
868
+
869
+
842
870
Attributes
843
871
----------
844
872
None
0 commit comments