diff options
Diffstat (limited to 'numpy/lib/recfunctions.py')
-rw-r--r-- | numpy/lib/recfunctions.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/numpy/lib/recfunctions.py b/numpy/lib/recfunctions.py index 3c0094aae..da0c3e8ac 100644 --- a/numpy/lib/recfunctions.py +++ b/numpy/lib/recfunctions.py @@ -614,8 +614,10 @@ def append_fields(base, names, data=None, dtypes=None, if dtypes is None: data = [np.array(a, copy=False, subok=True) for a in data] data = [a.view([(name, a.dtype)]) for (name, a) in zip(names, data)] - elif not hasattr(dtypes, '__iter__'): - dtypes = [dtypes, ] + else : + if not hasattr(dtypes, '__iter__'): + dtypes = [dtypes, ] + if len(data) != len(dtypes): if len(dtypes) == 1: dtypes = dtypes * len(data) |