From b90addd13f17d967d81dc1d7515887d4fcd6ef59 Mon Sep 17 00:00:00 2001 From: mattip Date: Thu, 2 May 2019 11:29:10 -0400 Subject: BUG: parse more subarrays in descr_to_dtype --- numpy/lib/format.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'numpy/lib/format.py') diff --git a/numpy/lib/format.py b/numpy/lib/format.py index abd98dd22..05fcbc0bc 100644 --- a/numpy/lib/format.py +++ b/numpy/lib/format.py @@ -267,10 +267,15 @@ def descr_to_dtype(descr): This function reverses the process, eliminating the empty padding fields. ''' - if isinstance(descr, (str, dict, tuple)): + if isinstance(descr, (str, dict)): # No padding removal needed return numpy.dtype(descr) - + elif isinstance(descr, tuple): + if isinstance(descr[0], list): + # subtype, will always have a shape descr[1] + dt = descr_to_dtype(descr[0]) + return numpy.dtype((dt, descr[1])) + return numpy.dtype(descr) fields = [] offset = 0 for field in descr: -- cgit v1.2.1