read_excel throws ValueError: cannot specify usecols when specifying a multi-index header
See original GitHub issuedf=pd.read_excel(xl_file, sheet_name=xl_sheet,header=[18,19], usecols='B,D:J,L')
Problem description
df=pd.read_excel(xl_file, sheet_name=xl_sheet,header=[18,19], usecols=‘B,D:J,L’)
throws the following error after conda update:
ValueError: cannot specify usecols when specifying a multi-index header
The script run perfectly fine before.
Expected Output
Dataframe with multi-index columns, as before.
Output of pd.show_versions()
INSTALLED VERSIONS
commit: None python: 3.7.1.final.0 python-bits: 64 OS: Windows OS-release: 7 machine: AMD64 processor: Intel64 Family 6 Model 60 Stepping 3, GenuineIntel byteorder: little LC_ALL: None LANG: None LOCALE: None.None
pandas: 0.24.1 pytest: 3.3.2 pip: 19.0.3 setuptools: 40.8.0 Cython: 0.27.3 numpy: 1.15.4 scipy: None pyarrow: None xarray: None IPython: 7.3.0 sphinx: 1.6.6 patsy: 0.5.0 dateutil: 2.8.0 pytz: 2018.9 blosc: None bottleneck: 1.2.1 tables: None numexpr: None feather: None matplotlib: 2.1.2 openpyxl: 2.4.10 xlrd: 1.1.0 xlwt: 1.3.0 xlsxwriter: 1.0.2 lxml.etree: None bs4: 4.6.0 html5lib: 1.0.1 sqlalchemy: 1.2.1 pymysql: None psycopg2: None jinja2: 2.10 s3fs: None fastparquet: None pandas_gbq: None pandas_datareader: None gcsfs: None
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:24 (7 by maintainers)
I also got the same issue
this bug still exist on version 1.2.4 …