You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
# Could not provide a copy-pastable Reproducible Example because of empty line bug in ".to_excel" https://github.com/pandas-dev/pandas/issues/27772# Please use either Screenshot or attached Excel-File.importpandasaspddf=pd.read_excel('sample.xlsx', index_col=[0, 1, 2], header=[0, 1, 2])
print(df.index)
MultiIndex([('A', 'AA', 'AAA'),
(nan, 'BB', 'BBB'),
(nan, 'CC', 'CCC'),
(nan, 'DD', 'DDD'),
(nan, 'EE', 'EEE')],
)
Issue Description
When importing a Excel-XSLX File (sample.xlsx) into pandas with .read_excel() the Multiindex is not handled properly.
Instead of copying the value of the first Index-Column-Cell into the Cells beneath it, it is pasting "NAN"s there.
This also doesn't change when merging the area to a merged cell.
Example Data in Excel/Calc:
Expected Behavior
It should copy the first Value in the Index-Column into the cells beneath them:
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
When importing a Excel-XSLX File (sample.xlsx) into pandas with .read_excel() the Multiindex is not handled properly.
Instead of copying the value of the first Index-Column-Cell into the Cells beneath it, it is pasting "NAN"s there.
This also doesn't change when merging the area to a merged cell.
Example Data in Excel/Calc:

Expected Behavior
It should copy the first Value in the Index-Column into the cells beneath them:
When commenting out the changes made with Issue:34673 it is working correctly:
pandas/pandas/io/excel/_base.py
Lines 804 to 808 in b022a3b
Installed Versions
The text was updated successfully, but these errors were encountered: