diff options
author | pierregm <pierregm@localhost> | 2009-10-16 09:13:12 +0000 |
---|---|---|
committer | pierregm <pierregm@localhost> | 2009-10-16 09:13:12 +0000 |
commit | ea99d11715fcef22e4bd9f3cb3b1624b0f3c2835 (patch) | |
tree | 29d0ac41c9aae5f8bf3eb7dfa60f6b2537ede1ec /numpy/lib/io.py | |
parent | e8f48653c396a1ae2e838cc1f463d5c32cf1d6fa (diff) | |
download | numpy-ea99d11715fcef22e4bd9f3cb3b1624b0f3c2835.tar.gz |
* io.genfromtxt
- fixed an issue when an explicit dtype has the right size, but the names don't
Diffstat (limited to 'numpy/lib/io.py')
-rw-r--r-- | numpy/lib/io.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/lib/io.py b/numpy/lib/io.py index cb8c63666..6f6815e81 100644 --- a/numpy/lib/io.py +++ b/numpy/lib/io.py @@ -1104,8 +1104,8 @@ def genfromtxt(fname, dtype=float, comments='#', delimiter=None, descr = dtype.descr dtype = np.dtype([descr[_] for _ in usecols]) names = list(dtype.names) - # If the dtype is None, update the names - elif names is not None: + # If `names` is not None, update the names + elif (names is not None) and (len(names) > nbcols): names = [names[_] for _ in usecols] |