Skip to content

sheet_name argument from read_excel is always giving the first sheet #17107

Closed
@rubennj

Description

@rubennj

Code Sample, a copy-pastable example if possible

pd.read_excel(filename, sheet_name='sheet1')
pd.read_excel(filename, sheet_name='sheet2')

Problem description

First of all, right now there is PR #16442 to homogenize arguments names, but in 0.20.3 both arguments are accepted although only sheetname is documented.

The problem is that sheet_name is silently failing and returning always the first sheet.

sheetname is OK, but with PR #16442 this issue could be already fixed or even more messy.

Expected Output

The chosen sheet.

Output of pd.show_versions()

commit: None
python: 3.6.2.final.0
python-bits: 64
OS: Windows
OS-release: 10
machine: AMD64
processor: Intel64 Family 6 Model 61 Stepping 4, GenuineIntel
byteorder: little
LC_ALL: None
LANG: es
LOCALE: None.None

pandas: 0.20.3
pytest: None
pip: 9.0.1
setuptools: 27.2.0
Cython: None
numpy: 1.13.1
scipy: 0.19.1
xarray: None
IPython: 6.1.0
sphinx: 1.6.2
patsy: None
dateutil: 2.6.1
pytz: 2017.2
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: 0.4.0
matplotlib: 2.0.2
openpyxl: 2.4.7
xlrd: 1.0.0
xlwt: None
xlsxwriter: 0.9.6
lxml: 3.7.3
bs4: 4.6.0
html5lib: 0.999
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.9.6
s3fs: None
pandas_gbq: None
pandas_datareader: None

Metadata

Metadata

Assignees

No one assigned

    Labels

    IO Excelread_excel, to_excel

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions