Skip to content

read_excel return empty dataframe when using usecols #18273

Closed
@SenWang

Description

@SenWang
In [3]: data = pd.read_excel("A.xlsx")

In [4]: data
Out[4]:
   A  B
0  1  2
1  3  4

In [5]: data1 = pd.read_excel("A.xlsx",usecols=['B'])

In [6]: data1
Out[6]:
Empty DataFrame
Columns: []
Index: []

In [7]: pd.__version__
Out[7]: '0.21.0'

Problem description

Having a excel file name A.xlsx(or A.xls) with column A,B
read_excel return empty dataframe if usecols used

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIO Excelread_excel, to_excelRegressionFunctionality that used to work in a prior pandas versiongood first issue

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions