Skip to content

DOCS: Add comment about index_col and forward filling missing values #45989

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 14, 2022
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
4 changes: 4 additions & 0 deletions doc/source/user_guide/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3675,6 +3675,10 @@ should be passed to ``index_col`` and ``header``:
os.remove("path_to_file.xlsx")
Missing values in columns specified in ``index_col`` will be forward filled to
allow roundtripping with ``to_excel`` for ``merged_cells=True``. To avoid forward
filling the missing values use ``set_index`` after reading the data instead of
``index_col``.

Parsing specific columns
++++++++++++++++++++++++
Expand Down
5 changes: 5 additions & 0 deletions pandas/io/excel/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@
those columns will be combined into a ``MultiIndex``. If a
subset of data is selected with ``usecols``, index_col
is based on the subset.
Missing values will be forward filled to allow roundtripping with
``to_excel`` for ``merged_cells=True``. To avoid forward filling the
missing values use ``set_index`` after reading the data instead of
``index_col``.
usecols : str, list-like, or callable, default None
* If None, then parse all columns.
* If str, then indicates comma separated list of Excel column letters
Expand Down