From 927e8809cb566722b1bd0b15dca9f030f3cd29b9 Mon Sep 17 00:00:00 2001 From: Sebastian Berg Date: Wed, 2 Dec 2015 21:08:24 +0100 Subject: BUG: resizing empty array with complex dtype failed This is because the dtype was passed into the new array as a char, and many dtypes do not have a valid char representation. Closes gh-6740 --- numpy/core/fromnumeric.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'numpy/core/fromnumeric.py') diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py index 0fc572cb6..197513294 100644 --- a/numpy/core/fromnumeric.py +++ b/numpy/core/fromnumeric.py @@ -1134,7 +1134,7 @@ def resize(a, new_shape): a = ravel(a) Na = len(a) if not Na: - return mu.zeros(new_shape, a.dtype.char) + return mu.zeros(new_shape, a.dtype) total_size = um.multiply.reduce(new_shape) n_copies = int(total_size / Na) extra = total_size % Na -- cgit v1.2.1