summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2019-05-15 22:35:06 -0700
committerGitHub <noreply@github.com>2019-05-15 22:35:06 -0700
commitd7e1fcbc2cd9e7a1eea5e04d8fee5909b07b8076 (patch)
treed3a66de912fd9267ecc5ad9654273784eb49796c
parent5bf9ab98edd254dee1162d6f1863053e040cf828 (diff)
parent6879dcd5041a64327d0245263347a91f35e96a95 (diff)
downloadnumpy-d7e1fcbc2cd9e7a1eea5e04d8fee5909b07b8076.tar.gz
Merge pull request #13397 from Bharat123rox/fix-genfromtxt
DOC: Resolve confusion regarding hashtag in header line of csv
-rw-r--r--numpy/lib/npyio.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/numpy/lib/npyio.py b/numpy/lib/npyio.py
index 694ad1694..1845305d1 100644
--- a/numpy/lib/npyio.py
+++ b/numpy/lib/npyio.py
@@ -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: