diff options
author | Travis E. Oliphant <teoliphant@gmail.com> | 2013-01-21 20:40:59 -0600 |
---|---|---|
committer | Travis E. Oliphant <teoliphant@gmail.com> | 2013-01-21 20:40:59 -0600 |
commit | ce5506f73bbb0233e825efef4f94dd39de05be07 (patch) | |
tree | e0ee6107b9dc22bb857b15a85f72cac812690d46 /numpy/lib/index_tricks.py | |
parent | 963c4e46dc56020ebea05bee10ceaa0feb61f022 (diff) | |
download | numpy-ce5506f73bbb0233e825efef4f94dd39de05be07.tar.gz |
Fix-up logic for checking for zero-d arrays.
Diffstat (limited to 'numpy/lib/index_tricks.py')
-rw-r--r-- | numpy/lib/index_tricks.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/numpy/lib/index_tricks.py b/numpy/lib/index_tricks.py index 852c5f6fd..15a1a559d 100644 --- a/numpy/lib/index_tricks.py +++ b/numpy/lib/index_tricks.py @@ -535,7 +535,9 @@ class ndindex(object): # Fixing nditer would be more work but should be done eventually, # and then this entire __new__ method can be removed. def __new__(cls, *shape): - if len(shape) == 0 or (len(shape) == 1 and len(shape[0]) == 0): + if len(shape) == 1 and isinstance(shape[0], tuple): + shape = shape[0] + if len(shape) == 0: class zero_dim_iter(object): def __init__(self): self._N = 1 |