Skip to content
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

BUG: read_excel: incorrect multi-index values - 3 #34676

Closed
2 of 3 tasks
kuraga opened this issue Jun 9, 2020 · 5 comments
Closed
2 of 3 tasks

BUG: read_excel: incorrect multi-index values - 3 #34676

kuraga opened this issue Jun 9, 2020 · 5 comments
Labels
Bug IO Excel read_excel, to_excel MultiIndex Needs Info Clarification about behavior needed to assess issue

Comments

@kuraga
Copy link

kuraga commented Jun 9, 2020

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • (optional) I have confirmed this bug exists on the master branch of pandas.


Code Sample, a copy-pastable example

import pandas as pd
df = pd.read_excel('test.xlsx', header=[0, 1], index_col=[0, 1])
print(df.index)
print(df.index)

(engine could be xlrd or openpyxl, doesn't matter.)

test.xlsx
image

Problem description

MultiIndex([(nan, nan),
            ('x', 'y')],
           names=['A', 'B'])
Index(['C', 'Unnamed: 3'], dtype='object')

Expected Output

I'm not sure exactly.

Output of pd.show_versions()

INSTALLED VERSIONS

commit : None
python : 3.7.7.final.0
python-bits : 64
OS : Linux
OS-release : 5.4.42-calculate
machine : x86_64
processor : Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
byteorder : little
LC_ALL : None
LANG : ru_RU.utf8
LOCALE : ru_RU.UTF-8

pandas : 1.0.3
numpy : 1.18.1
pytz : 2020.1
dateutil : 2.8.1
pip : 20.0.2
setuptools : 46.4.0.post20200518
Cython : 0.29.17
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : 1.2.8
lxml.etree : 4.5.0
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 2.11.2
IPython : 7.13.0
pandas_datareader: None
bs4 : None
bottleneck : None
fastparquet : None
gcsfs : None
lxml.etree : 4.5.0
matplotlib : 3.1.3
numexpr : None
odfpy : None
openpyxl : 3.0.3
pandas_gbq : None
pyarrow : None
pytables : None
pytest : None
pyxlsb : None
s3fs : None
scipy : 1.4.1
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : 1.2.0
xlwt : None
xlsxwriter : 1.2.8
numba : None

@kuraga kuraga added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Jun 9, 2020
@TomAugspurger
Copy link
Contributor

@kuraga can you include the code to generate the test.xlsx file? We'd need that for a unit test anyway.

What's the expected ouput?

@TomAugspurger TomAugspurger added IO Excel read_excel, to_excel MultiIndex Needs Info Clarification about behavior needed to assess issue and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Sep 4, 2020
@kuraga
Copy link
Author

kuraga commented Sep 7, 2020

@TomAugspurger I made them in LibreOffice Writer.

@mroeschke
Copy link
Member

Let us know if could provide the expected output for this issue, going to close in the meantime due to inactivity.

@kuraga
Copy link
Author

kuraga commented Mar 27, 2021

@mroeschke , which output is correct on your mind for this file?

@mroeschke
Copy link
Member

I am not sure either what the result should be for this file. It's an oddly formatted file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug IO Excel read_excel, to_excel MultiIndex Needs Info Clarification about behavior needed to assess issue
Projects
None yet
Development

No branches or pull requests

3 participants