summaryrefslogtreecommitdiff
path: root/numpy/lib/recfunctions.py
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2019-05-19 09:34:58 +0300
committerGitHub <noreply@github.com>2019-05-19 09:34:58 +0300
commitecb402499dba2d105b2714a55259352c31a62bd5 (patch)
treebcf388f945fc2eb9d4c151f776e030a65fb7fed7 /numpy/lib/recfunctions.py
parentdb595a0c4064956d2f2f904ed4a76443322bb7e9 (diff)
parent7495de475c8c578a0c39b09bc55a88a93aa1985a (diff)
downloadnumpy-ecb402499dba2d105b2714a55259352c31a62bd5.tar.gz
Merge branch 'master' into npy-2.1
Diffstat (limited to 'numpy/lib/recfunctions.py')
-rw-r--r--numpy/lib/recfunctions.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/lib/recfunctions.py b/numpy/lib/recfunctions.py
index ccbcfad91..08a9cf09c 100644
--- a/numpy/lib/recfunctions.py
+++ b/numpy/lib/recfunctions.py
@@ -976,7 +976,7 @@ def structured_to_unstructured(arr, dtype=None, copy=False, casting='unsafe'):
# next cast to a packed format with all fields converted to new dtype
packed_fields = np.dtype({'names': names,
- 'formats': [(out_dtype, c) for c in counts]})
+ 'formats': [(out_dtype, dt.shape) for dt in dts]})
arr = arr.astype(packed_fields, copy=copy, casting=casting)
# finally is it safe to view the packed fields as the unstructured type
@@ -1069,7 +1069,7 @@ def unstructured_to_structured(arr, dtype=None, names=None, align=False,
# first view as a packed structured array of one dtype
packed_fields = np.dtype({'names': names,
- 'formats': [(arr.dtype, c) for c in counts]})
+ 'formats': [(arr.dtype, dt.shape) for dt in dts]})
arr = np.ascontiguousarray(arr).view(packed_fields)
# next cast to an unpacked but flattened format with varied dtypes