Skip to content

Commit 14d5576

Browse files
committed
DOC: Clarify interaction of read_csv nrows with other args (pandas-dev#59078)
1 parent 1cf98aa commit 14d5576

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

pandas/io/parsers/readers.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,17 @@ class _read_shared(TypedDict, Generic[HashableT], total=False):
268268
skipfooter : int, default 0
269269
Number of lines at bottom of file to skip (Unsupported with ``engine='c'``).
270270
nrows : int, optional
271-
Number of rows of file to read. Useful for reading pieces of large files.
271+
Number of rows of data to read. Useful for reading pieces of large files.
272+
The following rows are excluded from the count:
273+
274+
* The header row containing column names,
275+
* Rows before the header row, if ``header=1`` or larger,
276+
* Fully commented rows,
277+
* Rows skipped with ``skiprows``,
278+
* Skipped blank lines.
279+
280+
Records containing text with newline characters within quotes
281+
or escaped newline characters will be counted as one row.
272282
na_values : Hashable, Iterable of Hashable or dict of {{Hashable : Iterable}}, optional
273283
Additional strings to recognize as ``NA``/``NaN``. If ``dict`` passed, specific
274284
per-column ``NA`` values. By default the following values are interpreted as

0 commit comments

Comments
 (0)