_sql.html)
    * [ pandas.read_gbq ](pandas.read_gbq.html)
    * [ pandas.read_stata ](pandas.read_stata.html)
    * [ pandas.DataFrame.to_stata ](pandas.DataFrame.to_stata.html)
    * [ pandas.io.stata.StataReader.data_label ](pandas.io.stata.StataReader.data_label.html)
    * [ pandas.io.stata.StataReader.value_labels ](pandas.io.stata.StataReader.value_labels.html)
    * [ pandas.io.stata.StataReader.variable_labels ](pandas.io.stata.StataReader.variable_labels.html)
    * [ pandas.io.stata.StataWriter.write_file ](pandas.io.stata.StataWriter.write_file.html)
  * [ General functions ](../general_functions.html)
  * [ Series ](../series.html)
  * [ DataFrame ](../frame.html)
  * [ pandas arrays, scalars, and data types ](../arrays.html)
  * [ Index objects ](../indexing.html)
  * [ Date offsets ](../offset_frequency.html)
  * [ Window ](../window.html)
  * [ GroupBy ](../groupby.html)
  * [ Resampling ](../resampling.html)
  * [ Style ](../style.html)
  * [ Plotting ](../plotting.html)
  * [ Options and settings ](../options.html)
  * [ Extensions ](../extensions.html)
  * [ Testing ](../testing.html)
  * [ Missing values ](../missing_value.html)

  * [ __ ](../../index.html)
  * [ API reference ](../index.html)
  * [ Input/output ](../io.html)
  * pandas.DataF... 

#  pandas.DataFrame.to_excel  #

DataFrame.  to_excel  (  _ excel_writer  _ , _ *  _ , _ sheet_name  =
'Sheet1'  _ , _ na_rep  =  ''  _ , _ float_format  =  None  _ , _ columns  =
None  _ , _ header  =  True  _ , _ index  =  True  _ , _ index_label  =  None
_ , _ startrow  =  0  _ , _ startcol  =  0  _ , _ engine  =  None  _ , _
merge_cells  =  True  _ , _ inf_rep  =  'inf'  _ , _ freeze_panes  =  None  _
, _ storage_options  =  None  _ , _ engine_kwargs  =  None  _ )  [ [source]
](https://github.com/pandas-
dev/pandas/blob/v2.2.2/pandas/core/generic.py#L2262-L2426) #

    

Write object to an Excel sheet.

To write a single object to an Excel .xlsx file it is only necessary to
specify a target file name. To write to multiple sheets it is necessary to
create an  ExcelWriter  object with a target file name, and specify a sheet in
the file to write to.

Multiple sheets may be written to by specifying unique  sheet_name  . With all
data written to the file it is necessary to save the changes. Note that
creating an  ExcelWriter  object with a file name that already exists will
result in the contents of the existing file being erased.

Parameters  :

    

**excel_writer** path-like, file-like, or ExcelWriter object

    

File path or existing ExcelWriter.

**sheet_name** str, default âSheet1â

    

Name of sheet which will contain DataFrame.

**na_rep** str, default ââ

    

Missing data representation.

**float_format** str, optional

    

Format string for floating point numbers. For example ` float_format="%.2f"  `
will format 0.1234 to 0.12.

**columns** sequence or list of str, optional

    

Columns to write.

**header** bool or list of str, default True

    

Write out the column names. If a list of string is given it is assumed to be
aliases for the column names.

**index** bool, default True

    

Write row names (index).

**index_label** str or sequence, optional

    

Column label for index column(s) if desired. If not specified, and  header
and  index  are True, then the index names are used. A sequence should be
given if the DataFrame uses MultiIndex.

**startrow** int, default 0

    

Upper left cell row to dump data frame.

**startcol** int, default 0

    

Upper left cell column to dump data frame.

**engine** str, optional

    

Write engine to use, âopenpyxlâ or âxlsxwriterâ. You can also set this
via the options ` io.excel.xlsx.writer  ` or ` io.excel.xlsm.writer  ` .

**merge_cells** bool, default True

    

Write MultiIndex and Hierarchical Rows as merged cells.

**inf_rep** str, default âinfâ

    

Representation for infinity (there is no native representation for infinity in
Excel).

**freeze_panes** tuple of in