Skip to content

Commit

Permalink
Merge pull request numpy#13397 from Bharat123rox/fix-genfromtxt
Browse files Browse the repository at this point in the history
DOC: Resolve confusion regarding hashtag in header line of csv
  • Loading branch information
mattip authored May 16, 2019
2 parents 5bf9ab9 + 6879dcd commit d7e1fcb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions numpy/lib/npyio.py
Original file line number Diff line number Diff line change
Expand Up @@ -1717,6 +1717,16 @@ def genfromtxt(fname, dtype=float, comments='#', delimiter=None,
array((1, 1.3, b'abcde'),
dtype=[('intvar', '<i8'), ('fltvar', '<f8'), ('strvar', 'S5')])
An example to show comments
>>> f = StringIO('''
... text,# of chars
... hello world,11
... numpy,5''')
>>> np.genfromtxt(f, dtype='S12,S12', delimiter=',')
array([(b'text', b''), (b'hello world', b'11'), (b'numpy', b'5')],
dtype=[('f0', 'S12'), ('f1', 'S12')])
"""
if max_rows is not None:
if skip_footer:
Expand Down

0 comments on commit d7e1fcb

Please sign in to comment.