diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2019-04-14 19:26:53 -0700 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2019-04-15 22:26:19 -0700 |
commit | b5895be146cdc3063ffa9ca8ae27b5bcf7992719 (patch) | |
tree | 527d2ed54be1fa1f068d740aba555c845761bb9a /numpy/lib/recfunctions.py | |
parent | 191d5c78383771e9a4825801062d0f23625410bf (diff) | |
download | numpy-b5895be146cdc3063ffa9ca8ae27b5bcf7992719.tar.gz |
BUG: Fix structured_to_unstructured on single-field types
Previously a single-field type would decay, which is undesirable.
The included test previously did not pass
Diffstat (limited to 'numpy/lib/recfunctions.py')
-rw-r--r-- | numpy/lib/recfunctions.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/lib/recfunctions.py b/numpy/lib/recfunctions.py index fcc0d9a7a..bf588a490 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'): arr = arr.astype(packed_fields, copy=copy, casting=casting) # finally is it safe to view the packed fields as the unstructured type - return arr.view((out_dtype, sum(counts))) + return arr.view((out_dtype, (sum(counts),))) def _unstructured_to_structured_dispatcher(arr, dtype=None, names=None, align=None, copy=None, casting=None): |