@@ -2619,65 +2619,11 @@ def to_csv(self, path=None, index=True, sep=",", na_rep='',
26192619 if path is None :
26202620 return result
26212621
2622+ @Appender (generic ._shared_docs ['to_excel' ] % _shared_doc_kwargs )
26222623 def to_excel (self , excel_writer , sheet_name = 'Sheet1' , na_rep = '' ,
26232624 float_format = None , columns = None , header = True , index = True ,
26242625 index_label = None , startrow = 0 , startcol = 0 , engine = None ,
26252626 merge_cells = True , encoding = None , inf_rep = 'inf' , verbose = True ):
2626- """
2627- Write Series to a excel sheet
2628-
2629- Parameters
2630- ----------
2631- excel_writer : string or ExcelWriter object
2632- File path or existing ExcelWriter
2633- sheet_name : string, default 'Sheet1'
2634- Name of sheet which will contain DataFrame
2635- na_rep : string, default ''
2636- Missing data representation
2637- float_format : string, default None
2638- Format string for floating point numbers
2639- columns : sequence, optional
2640- Columns to write
2641- header : boolean or list of string, default True
2642- Write out column names. If a list of string is given it is
2643- assumed to be aliases for the column names
2644- index : boolean, default True
2645- Write row names (index)
2646- index_label : string or sequence, default None
2647- Column label for index column(s) if desired. If None is given, and
2648- `header` and `index` are True, then the index names are used. A
2649- sequence should be given if the DataFrame uses MultiIndex.
2650- startrow :
2651- upper left cell row to dump data frame
2652- startcol :
2653- upper left cell column to dump data frame
2654- engine : string, default None
2655- write engine to use - you can also set this via the options
2656- ``io.excel.xlsx.writer``, ``io.excel.xls.writer``, and
2657- ``io.excel.xlsm.writer``.
2658- merge_cells : boolean, default True
2659- Write MultiIndex and Hierarchical Rows as merged cells.
2660- encoding: string, default None
2661- encoding of the resulting excel file. Only necessary for xlwt,
2662- other writers support unicode natively.
2663- inf_rep : string, default 'inf'
2664- Representation for infinity (there is no native representation for
2665- infinity in Excel)
2666-
2667- Notes
2668- -----
2669- If passing an existing ExcelWriter object, then the sheet will be added
2670- to the existing workbook. This can be used to save different
2671- DataFrames to one workbook:
2672-
2673- >>> writer = ExcelWriter('output.xlsx')
2674- >>> s.to_excel(writer,'Sheet1')
2675- >>> s.to_excel(writer,'Sheet2')
2676- >>> writer.save()
2677-
2678- For compatibility with to_csv, to_excel serializes lists and dicts to
2679- strings before writing.
2680- """
26812627 df = self .to_frame ()
26822628 df .to_excel (excel_writer = excel_writer , sheet_name = sheet_name ,
26832629 na_rep = na_rep , float_format = float_format , columns = columns ,
0 commit comments