diff options
Diffstat (limited to 'numpy/core/records.py')
| -rw-r--r-- | numpy/core/records.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/numpy/core/records.py b/numpy/core/records.py index b3474ad01..2c20b7d45 100644 --- a/numpy/core/records.py +++ b/numpy/core/records.py @@ -664,17 +664,17 @@ def fromarrays(arrayList, dtype=None, shape=None, formats=None, if nn > 0: shape = shape[:-nn] + _array = recarray(shape, descr) + + # populate the record array (makes a copy) for k, obj in enumerate(arrayList): nn = descr[k].ndim testshape = obj.shape[:obj.ndim - nn] + name = _names[k] if testshape != shape: - raise ValueError("array-shape mismatch in array %d" % k) + raise ValueError(f'array-shape mismatch in array {k} ("{name}")') - _array = recarray(shape, descr) - - # populate the record array (makes a copy) - for i in range(len(arrayList)): - _array[_names[i]] = arrayList[i] + _array[name] = obj return _array |
