diff options
author | Alan Briolat <alan.briolat@gmail.com> | 2014-04-29 11:23:10 +0100 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2015-01-23 14:58:50 -0700 |
commit | 1b88f08b4f27e26adc7a1200a51974eb5bf719e0 (patch) | |
tree | 2c625fe5bdf78f59c3d6624050c619cd867fb281 /numpy/lib/npyio.py | |
parent | d44604ef625ff38e835a51cad3bcd24400278eff (diff) | |
download | numpy-1b88f08b4f27e26adc7a1200a51974eb5bf719e0.tar.gz |
BUG: Fix genfromtext NameValidator arguments passed to easy_dtype.
np.genfromtxt validates field names twice: once in genfromtxt and once
in easy_dtype. Whilst the arguments to genfromtxt are used in the first
validation, they aren't passed to easy_dtype (which is used only when
dtype != None) and therefore in this case the default validation (strip
non-alphanum, replace spaces) gets confusingly applied, ignoring
genfromtxt's arguments.
This patch adds fixes genfromtxt by passing the appropriate arguments
onwards to easy_dtype. That is probably the least invasive way to fix
the issue.
Diffstat (limited to 'numpy/lib/npyio.py')
-rw-r--r-- | numpy/lib/npyio.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/numpy/lib/npyio.py b/numpy/lib/npyio.py index a40de4fea..04b57e7bb 100644 --- a/numpy/lib/npyio.py +++ b/numpy/lib/npyio.py @@ -1451,7 +1451,11 @@ def genfromtxt(fname, dtype=float, comments='#', delimiter=None, names = validate_names(names) # Get the dtype if dtype is not None: - dtype = easy_dtype(dtype, defaultfmt=defaultfmt, names=names) + dtype = easy_dtype(dtype, defaultfmt=defaultfmt, names=names, + excludelist=excludelist, + deletechars=deletechars, + case_sensitive=case_sensitive, + replace_space=replace_space) # Make sure the names is a list (for 2.5) if names is not None: names = list(names) |