Skip to content

DOC: read_excel - improve parse_cols docstring #16580

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

Closed
BLMeltdown opened this issue Jun 2, 2017 · 2 comments · Fixed by #16658
Closed

DOC: read_excel - improve parse_cols docstring #16580

BLMeltdown opened this issue Jun 2, 2017 · 2 comments · Fixed by #16658
Labels
Docs IO Excel read_excel, to_excel
Milestone

Comments

@BLMeltdown
Copy link

BLMeltdown commented Jun 2, 2017

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

"parse_cols : int or list, default None

    If None then parse all columns,
    If int then indicates last column to be parsed
    If list of ints then indicates list of column numbers to be parsed
    If string then indicates comma separated list of column names and column ranges (e.g. “A:E” or “A,C,E:F”)

"

I think the formulation "column names" is ambiguous, as it can refer to "columns letters" or "columns header", because of Excel terminology.
"Column names" as "headers" actually don't work as entries for this function.

In addition, slices don't work as usual, as they include the last column of the slice. This is unexpected behavior given the usual python slicing modus operandi, and if it is not changed, it should be at least documented (I feel like it should be both, as we should stay true to language syntax and document it as it can be confusing, as A:D in vba/excel language includes D).

@chris-b1
Copy link
Contributor

chris-b1 commented Jun 2, 2017

Sure, PR welcome to make this clearer.

@chris-b1 chris-b1 added this to the Next Major Release milestone Jun 2, 2017
@chris-b1
Copy link
Contributor

chris-b1 commented Jun 2, 2017

Note that we slightly break with python convention when slicing labels and include the endpoint (e.g. docs here - I think the same behavior is appropriate here.

@chris-b1 chris-b1 changed the title Docs - pandas.read_excel DOC: read_excel - improve parse_cols docstring Jun 2, 2017
@jreback jreback modified the milestones: 0.20.3, Next Major Release Jun 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs IO Excel read_excel, to_excel
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants