def to_excel(self, excel_writer: Union[(str, pd.ExcelWriter)], sheet_name: str='Sheet1', na_rep: str='', float_format: Optional[str]=None, columns: Optional[Union[(str, List[str])]]=None, header: bool=True, index: bool=True, index_label: Optional[Union[(str, List[str])]]=None, startrow: int=0, startcol: int=0, engine: Optional[str]=None, merge_cells: bool=True, encoding: Optional[str]=None, inf_rep: str='inf', verbose: bool=True, freeze_panes: Optional[Tuple[(int, int)]]=None) -> None:
    '\n        Write object to an Excel sheet.\n\n        .. note:: This method should only be used if the resulting DataFrame is expected\n                  to be small, as all the data is loaded into the driver\'s memory.\n\n        To write a single object to an Excel .xlsx file it is only necessary to\n        specify a target file name. To write to multiple sheets it is necessary to\n        create an `ExcelWriter` object with a target file name, and specify a sheet\n        in the file to write to.\n\n        Multiple sheets may be written to by specifying unique `sheet_name`.\n        With all data written to the file it is necessary to save the changes.\n        Note that creating an `ExcelWriter` object with a file name that already\n        exists will result in the contents of the existing file being erased.\n\n        Parameters\n        ----------\n        excel_writer : str or ExcelWriter object\n            File path or existing ExcelWriter.\n        sheet_name : str, default \'Sheet1\'\n            Name of sheet which will contain DataFrame.\n        na_rep : str, default \'\'\n            Missing data representation.\n        float_format : str, optional\n            Format string for floating point numbers. For example\n            ``float_format="%%.2f"`` will format 0.1234 to 0.12.\n        columns : sequence or list of str, optional\n            Columns to write.\n        header : bool or list of str, default True\n            Write out the column names. If a list of string is given it is\n            assumed to be aliases for the column names.\n        index : bool, default True\n            Write row names (index).\n        index_label : str or sequence, optional\n            Column label for index column(s) if desired. If not specified, and\n            `header` and `index` are True, then the index names are used. A\n            sequence should be given if the DataFrame uses MultiIndex.\n        startrow : int, default 0\n            Upper left cell row to dump data frame.\n        startcol : int, default 0\n            Upper left cell column to dump data frame.\n        engine : str, optional\n            Write engine to use, \'openpyxl\' or \'xlsxwriter\'. You can also set this\n            via the options ``io.excel.xlsx.writer``, ``io.excel.xls.writer``, and\n            ``io.excel.xlsm.writer``.\n        merge_cells : bool, default True\n            Write MultiIndex and Hierarchical Rows as merged cells.\n        encoding : str, optional\n            Encoding of the resulting excel file. Only necessary for xlwt,\n            other writers support unicode natively.\n        inf_rep : str, default \'inf\'\n            Representation for infinity (there is no native representation for\n            infinity in Excel).\n        verbose : bool, default True\n            Display more information in the error logs.\n        freeze_panes : tuple of int (length 2), optional\n            Specifies the one-based bottommost row and rightmost column that\n            is to be frozen.\n\n        Notes\n        -----\n        Once a workbook has been saved it is not possible write further data\n        without rewriting the whole workbook.\n\n        See Also\n        --------\n        read_excel : Read Excel file.\n\n        Examples\n        --------\n        Create, write to and save a workbook:\n\n        >>> df1 = ps.DataFrame([[\'a\', \'b\'], [\'c\', \'d\']],\n        ...                    index=[\'row 1\', \'row 2\'],\n        ...                    columns=[\'col 1\', \'col 2\'])\n        >>> df1.to_excel("output.xlsx")  # doctest: +SKIP\n\n        To specify the sheet name:\n\n        >>> df1.to_excel("output.xlsx")  # doctest: +SKIP\n        >>> df1.to_excel("output.xlsx",\n        ...              sheet_name=\'Sheet_name_1\')  # doctest: +SKIP\n\n        If you wish to write to more than one sheet in the workbook, it is\n        necessary to specify an ExcelWriter object:\n\n        >>> with pd.ExcelWriter(\'output.xlsx\') as writer:  # doctest: +SKIP\n        ...      df1.to_excel(writer, sheet_name=\'Sheet_name_1\')\n        ...      df2.to_excel(writer, sheet_name=\'Sheet_name_2\')\n\n        To set the library that is used to write the Excel file,\n        you can pass the `engine` keyword (the default engine is\n        automatically chosen depending on the file extension):\n\n        >>> df1.to_excel(\'output1.xlsx\', engine=\'xlsxwriter\')  # doctest: +SKIP\n        '
    args = locals()
    psdf = self
    if isinstance(self, ps.DataFrame):
        f = pd.DataFrame.to_excel
    elif isinstance(self, ps.Series):
        f = pd.Series.to_excel
    else:
        raise TypeError(('Constructor expects DataFrame or Series; however, got [%s]' % (self,)))
    return validate_arguments_and_invoke_function(psdf._to_internal_pandas(), self.to_excel, f, args)
Write object to an Excel sheet.

.. note:: This method should only be used if the resulting DataFrame is expected
          to be small, as all the data is loaded into the driver's memory.

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 : str 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``, ``io.excel.xls.writer``, and
    ``io.excel.xlsm.writer``.
merge_cells : bool, default True
    Write MultiIndex and Hierarchical Rows as merged cells.
encoding : str, optional
    Encoding of the resulting excel file. Only necessary for xlwt,
    other writers support unicode natively.
inf_rep : str, default 'inf'
    Representation for infinity (there is no native representation for
    infinity in Excel).
verbose : bool, default True
    Display more information in the error logs.
freeze_panes : tuple of int (length 2), optional
    Specifies the one-based bottommost row and rightmost column that
    is to be frozen.

Notes
-----
Once a workbook has been saved it is not possible write further data
without rewriting the whole workbook.

See Also
--------
read_excel : Read Excel file.

Examples
--------
Create, write to and save a workbook:

>>> df1 = ps.DataFrame([['a', 'b'], ['c', 'd']],
...                    index=['row 1', 'row 2'],
...                    columns=['col 1', 'col 2'])
>>> df1.to_excel("output.xlsx")  # doctest: +SKIP

To specify the sheet name:

>>> df1.to_excel("output.xlsx")  # doctest: +SKIP
>>> df1.to_excel("output.xlsx",
...              sheet_name='Sheet_name_1')  # doctest: +SKIP

If you wish to write to more than one sheet in the workbook, it is
necessary to specify an ExcelWriter object:

>>> with pd.ExcelWriter('output.xlsx') as writer:  # doctest: +SKIP
...      df1.to_excel(writer, sheet_name='Sheet_name_1')
...      df2.to_excel(writer, sheet_name='Sheet_name_2')

To set the library that is used to write the Excel file,
you can pass the `engine` keyword (the default engine is
automatically chosen depending on the file extension):

>>> df1.to_excel('output1.xlsx', engine='xlsxwriter')  # doctest: +SKIP
def to_excel(self, excel_writer: Union[(str, pd.ExcelWriter)], sheet_name: str='Sheet1', na_rep: str=, float_format: Optional[str]=None, columns: Optional[Union[(str, List[str])]]=None, header: bool=True, index: bool=True, index_label: Optional[Union[(str, List[str])]]=None, startrow: int=0, startcol: int=0, engine: Optional[str]=None, merge_cells: bool=True, encoding: Optional[str]=None, inf_rep: str='inf', verbose: bool=True, freeze_panes: Optional[Tuple[(int, int)]]=None) -> None:
    '\n        Write object to an Excel sheet.\n\n        .. note:: This method should only be used if the resulting DataFrame is expected\n                  to be small, as all the data is loaded into the driver\'s memory.\n\n        To write a single object to an Excel .xlsx file it is only necessary to\n        specify a target file name. To write to multiple sheets it is necessary to\n        create an `ExcelWriter` object with a target file name, and specify a sheet\n        in the file to write to.\n\n        Multiple sheets may be written to by specifying unique `sheet_name`.\n        With all data written to the file it is necessary to save the changes.\n        Note that creating an `ExcelWriter` object with a file name that already\n        exists will result in the contents of the existing file being erased.\n\n        Parameters\n        ----------\n        excel_writer : str or ExcelWriter object\n            File path or existing ExcelWriter.\n        sheet_name : str, default \'Sheet1\'\n            Name of sheet which will contain DataFrame.\n        na_rep : str, default \'\'\n            Missing data representation.\n        float_format : str, optional\n            Format string for floating point numbers. For example\n            ``float_format="%%.2f"`` will format 0.1234 to 0.12.\n        columns : sequence or list of str, optional\n            Columns to write.\n        header : bool or list of str, default True\n            Write out the column names. If a list of string is given it is\n            assumed to be aliases for the column names.\n        index : bool, default True\n            Write row names (index).\n        index_label : str or sequence, optional\n            Column label for index column(s) if desired. If not specified, and\n            `header` and `index` are True, then the index names are used. A\n            sequence should be given if the DataFrame uses MultiIndex.\n        startrow : int, default 0\n            Upper left cell row to dump data frame.\n        startcol : int, default 0\n            Upper left cell column to dump data frame.\n        engine : str, optional\n            Write engine to use, \'openpyxl\' or \'xlsxwriter\'. You can also set this\n            via the options ``io.excel.xlsx.writer``, ``io.excel.xls.writer``, and\n            ``io.excel.xlsm.writer``.\n        merge_cells : bool, default True\n            Write MultiIndex and Hierarchical Rows as merged cells.\n        encoding : str, optional\n            Encoding of the resulting excel file. Only necessary for xlwt,\n            other writers support unicode natively.\n        inf_rep : str, default \'inf\'\n            Representation for infinity (there is no native representation for\n            infinity in Excel).\n        verbose : bool, default True\n            Display more information in the error logs.\n        freeze_panes : tuple of int (length 2), optional\n            Specifies the one-based bottommost row and rightmost column that\n            is to be frozen.\n\n        Notes\n        -----\n        Once a workbook has been saved it is not possible write further data\n        without rewriting the whole workbook.\n\n        See Also\n        --------\n        read_excel : Read Excel file.\n\n        Examples\n        --------\n        Create, write to and save a workbook:\n\n        >>> df1 = ps.DataFrame([[\'a\', \'b\'], [\'c\', \'d\']],\n        ...                    index=[\'row 1\', \'row 2\'],\n        ...                    columns=[\'col 1\', \'col 2\'])\n        >>> df1.to_excel("output.xlsx")  # doctest: +SKIP\n\n        To specify the sheet name:\n\n        >>> df1.to_excel("output.xlsx")  # doctest: +SKIP\n        >>> df1.to_excel("output.xlsx",\n        ...              sheet_name=\'Sheet_name_1\')  # doctest: +SKIP\n\n        If you wish to write to more than one sheet in the workbook, it is\n        necessary to specify an ExcelWriter object:\n\n        >>> with pd.ExcelWriter(\'output.xlsx\') as writer:  # doctest: +SKIP\n        ...      df1.to_excel(writer, sheet_name=\'Sheet_name_1\')\n        ...      df2.to_excel(writer, sheet_name=\'Sheet_name_2\')\n\n        To set the library that is used to write the Excel file,\n        you can pass the `engine` keyword (the default engine is\n        automatically chosen depending on the file extension):\n\n        >>> df1.to_excel(\'output1.xlsx\', engine=\'xlsxwriter\')  # doctest: +SKIP\n        '
    args = locals()
    psdf = self
    if isinstance(self, ps.DataFrame):
        f = pd.DataFrame.to_excel
    elif isinstance(self, ps.Series):
        f = pd.Series.to_excel
    else:
        raise TypeError(('Constructor expects DataFrame or Series; however, got [%s]' % (self,)))
    return validate_arguments_and_invoke_function(psdf._to_internal_pandas(), self.to_excel, f, args)