Skip to content

pandas.read_excel index_col argument behavior seems to be wrong (or unexpected, as by the docs) #16582

Closed
@BLMeltdown

Description

@BLMeltdown

http://pandas.pydata.org/pandas-docs/stable/generated/pandas.read_excel.html#pandas.read_excel

It's about the parameter index_col.

From the docs, I read

index_col : int, list of ints, default None

    Column (0-indexed) to use as the row labels of the DataFrame. Pass None if there is no such column. If a list is passed, those columns will be combined into a MultiIndex"

I use the function with args={index_col=3, parse_cols="D-J"} (so it should parse from column 3 to column 9 included, 0-indexed). And I expected D to be used as Index, but actually it was column G.
I am not sure if it is the expected behavior, if then, maybe argument order should be changed to show that index_col depends on parsed_cols.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions