Skip to content

DOC: clarified to_excel and read_excel (GH6260) #6302

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 9, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions doc/source/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1883,6 +1883,15 @@ Files with a ``.xls`` extension will be written using ``xlwt`` and those with a
``.xlsx`` extension will be written using ``xlsxwriter`` (if available) or
``openpyxl``.

The DataFrame will be written in a way that tries to mimic the REPL output. One
difference from 0.12.0 is that the ``index_label`` will be placed in the second
row instead of the first. You can get the previous behaviour by setting the
``merge_cells`` option in ``to_excel()`` to ``False``:

.. code-block:: python

df.to_excel('path_to_file.xlsx', index_label='label', merge_cells=False)

The Panel class also has a ``to_excel`` instance method,
which writes each DataFrame in the Panel to a separate sheet.

Expand Down
6 changes: 5 additions & 1 deletion pandas/io/excel.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ def read_excel(io, sheetname, **kwds):
convert_float : boolean, default True
convert integral floats to int (i.e., 1.0 --> 1). If False, all numeric
data will be read in as floats: Excel stores all numbers as floats
internally.
internally
has_index_names : boolean, default False
True if the cols defined in index_col have an index name and are
not in the header. Index name will be placed on a separate line below
the header.

Returns
-------
Expand Down