summaryrefslogtreecommitdiff
path: root/numpy/core/fromnumeric.py
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2015-12-02 21:08:24 +0100
committerSebastian Berg <sebastian@sipsolutions.net>2015-12-02 21:10:44 +0100
commit927e8809cb566722b1bd0b15dca9f030f3cd29b9 (patch)
tree2d306e4bc11026697fe647047a8e8b717d28891c /numpy/core/fromnumeric.py
parent45ff55634c0ddd44bd07141b3ffb6c4c5f08118c (diff)
downloadnumpy-927e8809cb566722b1bd0b15dca9f030f3cd29b9.tar.gz
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
Diffstat (limited to 'numpy/core/fromnumeric.py')
-rw-r--r--numpy/core/fromnumeric.py2
1 files changed, 1 insertions, 1 deletions
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