Skip to content

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

@Dr-Irv

Description

@Dr-Irv

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions