8000 Merge pull request #25813 from liang3zy22/gh637 · numpy/numpy@308273e · GitHub
[go: up one dir, main page]

Skip to content

Commit 308273e

Browse files
authored
Merge pull request #25813 from liang3zy22/gh637
DOC: Update genfromtxt documentation
2 parents 74893ab + 8644162 commit 308273e

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

numpy/lib/_npyio_impl.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1769,10 +1769,11 @@ def genfromtxt(fname, dtype=float, comments='#', delimiter=None,
17691769
names : {None, True, str, sequence}, optional
17701770
If `names` is True, the field names are read from the first line after
17711771
the first `skip_header` lines. This line can optionally be preceded
1772-
by a comment delimiter. If `names` is a sequence or a single-string of
1773-
comma-separated names, the names will be used to define the field names
1774-
in a structured dtype. If `names` is None, the names of the dtype
1775-
fields will be used, if any.
1772+
by a comment delimiter. Any content before the comment delimiter is
1773+
discarded. If `names` is a sequence or a single-string of
1774+
comma-separated names, the names will be used to define the field
1775+
names in a structured dtype. If `names` is None, the names of the
1776+
dtype fields will be used, if any.
17761777
excludelist : sequence, optional
17771778
A list of names to exclude. This list is appended to the default list
17781779
['return','file','print']. Excluded names are appended with an
@@ -1847,8 +1848,8 @@ def genfromtxt(fname, dtype=float, comments='#', delimiter=None,
18471848
-----
18481849
* When spaces are used as delimiters, or when no delimiter has been given
18491850
as input, there should not be any missing data between two fields.
1850-
* When variables are named (either by a flexible dtype or with `names`),
1851-
there must not be any header in the file (else a ValueError
1851+
* When variables are named (either by a flexible dtype or with a `names`
1852+
sequence), there must not be any header in the file (else a ValueError
18521853
exception is raised).
18531854
* Individual values are not stripped of spaces by default.
18541855
When using a custom converter, make sure the function does remove spaces.

0 commit comments

Comments
 (0)
0