summaryrefslogtreecommitdiff
path: root/numpy/lib/npyio.py
diff options
context:
space:
mode:
authorjason king <pizza@netspace.net.au>2015-09-05 23:01:24 +1000
committerCharles Harris <charlesr.harris@gmail.com>2015-10-04 14:42:30 -0600
commitae2d0bb7c2d227e893195cc3e52477567781e2db (patch)
tree6506061afe34a2aca455bf287c6ab2ed435d1da0 /numpy/lib/npyio.py
parent2bc213bb3a75069775bc2a6cbc43dc26e1664835 (diff)
downloadnumpy-ae2d0bb7c2d227e893195cc3e52477567781e2db.tar.gz
DOC: Update docs for numpy.genfromtxt.
Note that a list of strings can be passed as the first parameter. The strings are treated as the lines in a file. Closes #6247
Diffstat (limited to 'numpy/lib/npyio.py')
-rw-r--r--numpy/lib/npyio.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/numpy/lib/npyio.py b/numpy/lib/npyio.py
index 12052a08e..9f90039eb 100644
--- a/numpy/lib/npyio.py
+++ b/numpy/lib/npyio.py
@@ -1271,10 +1271,12 @@ def genfromtxt(fname, dtype=float, comments='#', delimiter=None,
Parameters
----------
- fname : file or str
- File, filename, or generator to read. If the filename extension is
+ fname : file, str, list of str
+ File, filename, list, or generator to read. If the filename extension is
`.gz` or `.bz2`, the file is first decompressed. Note that
generators must return byte strings in Python 3k.
+ The strings in a list or strings produced by a generator are treated
+ as lines.
dtype : dtype, optional
Data type of the resulting array.
If None, the dtypes will be determined by the contents of each
@@ -1455,7 +1457,7 @@ def genfromtxt(fname, dtype=float, comments='#', delimiter=None,
fhd = iter(fname)
except TypeError:
raise TypeError(
- "fname must be a string, filehandle, or generator. "
+ "fname must be a string, filehandle, list of strings, or generator. "
"(got %s instead)" % type(fname))
split_line = LineSplitter(delimiter=delimiter, comments=comments,