Skip to content

Commit 3932893

Browse files
use tuple index
1 parent f440ffb commit 3932893

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

wkcuber/downsampling.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,14 +360,14 @@ def _mode(x):
360360
slices = [slice(None)] * ndim
361361
slices[axis] = slice(1, None)
362362
# Reshape and compute final counts
363-
counts = counts.reshape(shape).transpose(transpose)[slices] + 1
363+
counts = counts.reshape(shape).transpose(transpose)[tuple(slices)] + 1
364364

365365
# Find maximum counts and return modals/counts
366366
slices = [slice(None, i) for i in sort.shape]
367367
del slices[axis]
368368
index = np.ogrid[slices]
369369
index.insert(axis, np.argmax(counts, axis=axis))
370-
return sort[index]
370+
return sort[tuple(index)]
371371

372372

373373
def downsample_cube(cube_buffer, factors, interpolation_mode):

0 commit comments

Comments
 (0)