Skip to content

Commit 7e26b60

Browse files
committed
GH17483 Added more explicit documentation of the 'infer' keyword to the 'header' parameter
1 parent 32f562d commit 7e26b60

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

pandas/io/parsers.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,19 @@
7474
.. versionadded:: 0.18.1 support for the Python parser.
7575
7676
header : int or list of ints, default 'infer'
77-
Row number(s) to use as the column names, and the start of the data.
78-
Default behavior is as if set to 0 if no ``names`` passed, otherwise
79-
``None``. Explicitly pass ``header=0`` to be able to replace existing
80-
names. The header can be a list of integers that specify row locations for
81-
a multi-index on the columns e.g. [0,1,3]. Intervening rows that are not
82-
specified will be skipped (e.g. 2 in this example is skipped). Note that
83-
this parameter ignores commented lines and empty lines if
84-
``skip_blank_lines=True``, so header=0 denotes the first line of data
85-
rather than the first line of the file.
77+
Row number(s) to use as the column names, and the start of the
78+
data. Default behavior is to infer the column names: if no names
79+
are passed the behavior is identical to ``header=0`` and column
80+
names are inferred from the first line of the file, if column
81+
names are passed explicitly then the behavior is identical to
82+
``header=None``. Explicitly pass ``header=0`` to be able to
83+
replace existing names. The header can be a list of integers that
84+
specify row locations for a multi-index on the columns
85+
e.g. [0,1,3]. Intervening rows that are not specified will be
86+
skipped (e.g. 2 in this example is skipped). Note that this
87+
parameter ignores commented lines and empty lines if
88+
``skip_blank_lines=True``, so header=0 denotes the first line of
89+
data rather than the first line of the file.
8690
names : array-like, default None
8791
List of column names to use. If file contains no header row, then you
8892
should explicitly pass header=None. Duplicates in this list will cause

0 commit comments

Comments
 (0)