8000 DOC: Clarify behavior of genfromtxt names field · numpy/numpy@0efac01 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0efac01

Browse files
author
David Freese
committed
DOC 8000 : Clarify behavior of genfromtxt names field
The documentation on the name parameter for npyio.genfromtxt uses the phrase "valid line" which doesn't completely describe it's behavior. This updates the documentation on the names field to indicate the first line, with or without a comment delimeter, will be taken for the names field. fixes #9878
1 parent 354b8e7 commit 0efac01

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

numpy/lib/npyio.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,11 +1418,12 @@ def genfromtxt(fname, dtype=float, comments='#', delimiter=None,
14181418
Which columns to read, with 0 being the first. For example,
14191419
``usecols = (1, 4, 5)`` will extract the 2nd, 5th and 6th columns.
14201420
names : {None, True, str, sequence}, optional
1421-
If `names` is True, the field names are read from the first valid line
1422-
after the first `skip_header` lines.
1423-
If `names` is a sequence or a single-string of comma-separated names,
1424-
the names will be used to define the field names in a structured dtype.
1425-
If `names` is None, the names of the dtype fields will be used, if any.
1421+
If `names` is True, the field names are read from the first line after
1422+
the first `skip_header` lines. This line can optionally be proceeded
1423+
by a comment delimeter. If `names` is a sequence or a single-string of
1424+
comma-separated names, the names will be used to define the field names
1425+
in a structured dtype. If `names` is None, the names of the dtype
1426+
fields will be used, if any.
14261427
excludelist : sequence, optional
14271428
A list of names to exclude. This list is appended to the default list
14281429
['return','file','print']. Excluded names are appended an underscore:

0 commit comments

Comments
 (0)
0