We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
ndim
1 parent 1e41afc commit 19d8782Copy full SHA for 19d8782
nibabel/fileslice.py
@@ -48,7 +48,7 @@ def is_fancy(sliceobj):
48
if not isinstance(sliceobj, tuple):
49
sliceobj = (sliceobj,)
50
for slicer in sliceobj:
51
- if hasattr(slicer, 'dtype') and slicer.ndim > 0: # ndarray always fancy
+ if getattr(slicer, 'ndim', 0) > 0: # ndarray always fancy, but scalars are safe
52
return True
53
# slice or Ellipsis or None OK for basic
54
if isinstance(slicer, slice) or slicer in (None, Ellipsis):
0 commit comments