From 483f565d85dadc899f94710531fba8355d554d59 Mon Sep 17 00:00:00 2001 From: Eric Wieser Date: Mon, 19 Aug 2019 17:07:05 -0500 Subject: MAINT: Fix remaining misuses of bool(dt.names) It's not clear that these have any visible effect, but we should be consistent with how we detect structured types. --- numpy/lib/recfunctions.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'numpy/lib/recfunctions.py') diff --git a/numpy/lib/recfunctions.py b/numpy/lib/recfunctions.py index a5d464e32..afb3186b2 100644 --- a/numpy/lib/recfunctions.py +++ b/numpy/lib/recfunctions.py @@ -70,7 +70,7 @@ def recursive_fill_fields(input, output): current = input[field] except ValueError: continue - if current.dtype.names: + if current.dtype.names is not None: recursive_fill_fields(current, output[field]) else: output[field][:len(current)] = current @@ -437,7 +437,7 @@ def merge_arrays(seqarrays, fill_value=-1, flatten=False, if isinstance(seqarrays, (ndarray, np.void)): seqdtype = seqarrays.dtype # Make sure we have named fields - if not seqdtype.names: + if seqdtype.names is None: seqdtype = np.dtype([('', seqdtype)]) if not flatten or zip_dtype((seqarrays,), flatten=True) == seqdtype: # Minimal processing needed: just make sure everythng's a-ok @@ -657,7 +657,7 @@ def rename_fields(base, namemapper): for name in ndtype.names: newname = namemapper.get(name, name) current = ndtype[name] - if current.names: + if current.names is not None: newdtype.append( (newname, _recursive_rename_fields(current, namemapper)) ) -- cgit v1.2.1