Skip to content
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

DOC: read_excel supports skiprows argument like read_csv, but tests and docs needed #36435

Closed
Dr-Irv opened this issue Sep 17, 2020 · 3 comments · Fixed by #36437
Closed

DOC: read_excel supports skiprows argument like read_csv, but tests and docs needed #36435

Dr-Irv opened this issue Sep 17, 2020 · 3 comments · Fixed by #36437
Assignees
Labels
Docs good first issue IO Excel read_excel, to_excel Needs Tests Unit test(s) needed to prevent regressions

Comments

@Dr-Irv
Copy link
Contributor

Dr-Irv commented Sep 17, 2020

Location of the documentation

https://pandas.pydata.org/docs/reference/api/pandas.read_excel.html
https://pandas.pydata.org/docs/reference/api/pandas.read_csv.html

Documentation problem

In read_csv, we say that we support:
skiprows list-like, int or callable, optional

Line numbers to skip (0-indexed) or number of lines to skip (int) at the start of the file.

If callable, the callable function will be evaluated against the row indices, returning True
if the row should be skipped and False otherwise. An example of a valid callable argument
would be lambda x: x in [0, 2].

In read_excel, we say that we support:

skiprows list-like

Rows to skip at the beginning (0-indexed).

It turns out that the int and callable arguments work fine with read_excel(), so we should indicate that in the documentation.
We also need to add tests for those 2 cases.

Suggested fix for documentation and additional tests

  • copy the read_csv doc for skiprows over to read_excel
  • add tests to tests/io/excel/test_readers.py for the int and callable options
@ahgamut
Copy link
Contributor

ahgamut commented Sep 17, 2020

I'd like to try this out. How do I assign the issue to myself?

@ahgamut
Copy link
Contributor

ahgamut commented Sep 17, 2020

take

@ahgamut
Copy link
Contributor

ahgamut commented Sep 18, 2020

@Dr-Irv I've submitted a PR (#36437) for this, and it has passed all CI checks except one: the travis-ci check is failing due to a stalled build (?).

conda env create -q --file=ci/deps/travis-37-cov.yaml

Collecting package metadata (repodata.json): ...working... done

Solving environment: ...working... 

No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.

Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#build-times-out-because-no-output-was-received

The build has been terminated

Dr-Irv pushed a commit that referenced this issue Sep 18, 2020
)

* DOC: updated read_excel skiprows documentation to match read_csv (GH36435)

* TST: updated read_excel test with skiprows as int, callable (GH36435)
kesmit13 pushed a commit to kesmit13/pandas that referenced this issue Nov 2, 2020
…6435) (pandas-dev#36437)

* DOC: updated read_excel skiprows documentation to match read_csv (GH36435)

* TST: updated read_excel test with skiprows as int, callable (GH36435)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs good first issue IO Excel read_excel, to_excel Needs Tests Unit test(s) needed to prevent regressions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants