summaryrefslogtreecommitdiff
path: root/numpy/lib/recfunctions.py
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2017-07-01 15:42:46 +0100
committerEric Wieser <wieser.eric@gmail.com>2017-07-01 15:42:46 +0100
commit1c76fed4aa3cbead721b90bef6ccbefbcc61dbd2 (patch)
tree413cb307856d241e812be96b635d4e687cf2e8e3 /numpy/lib/recfunctions.py
parent87c1b1f56af5fe2796cb78dd9bc76e92cb2e1f93 (diff)
downloadnumpy-1c76fed4aa3cbead721b90bef6ccbefbcc61dbd2.tar.gz
MAINT: Shortcut for flat dtypes wasn't used for scalar dtypes
Diffstat (limited to 'numpy/lib/recfunctions.py')
-rw-r--r--numpy/lib/recfunctions.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/numpy/lib/recfunctions.py b/numpy/lib/recfunctions.py
index 0a1a259d8..2b89ee0a4 100644
--- a/numpy/lib/recfunctions.py
+++ b/numpy/lib/recfunctions.py
@@ -416,12 +416,12 @@ def merge_arrays(seqarrays, fill_value=-1, flatten=False,
# Do we have a single ndarray as input ?
if isinstance(seqarrays, (ndarray, np.void)):
seqdtype = seqarrays.dtype
+ # Make sure we have named fields
+ if not seqdtype.names:
+ seqdtype = np.dtype([('', seqdtype)])
if not flatten or zip_dtype((seqarrays,), flatten=True) == seqdtype:
# Minimal processing needed: just make sure everythng's a-ok
seqarrays = seqarrays.ravel()
- # Make sure we have named fields
- if not seqdtype.names:
- seqdtype = [('', seqdtype)]
# Find what type of array we must return
if usemask:
if asrecarray: