8000 STY: ma.extras.median: avoid indexing with list · numpy/numpy@a4cc361 · GitHub
[go: up one dir, main page]

Skip to content

Commit a4cc361

Browse files
STY: ma.extras.median: avoid indexing with list
Recommended type for nd-indexing is a tuple. See #4434
1 parent bb46a49 commit a4cc361

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

numpy/ma/extras.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -665,10 +665,10 @@ def _median(a, axis=None, out=None, overwrite_input=False):
665665
ind = np.meshgrid(*axes_grid, sparse=True, indexing='ij')
666666
# insert indices of low and high median
667667
ind.insert(axis, h - 1)
668-
low = asorted[ind]
668+
low = asorted[tuple(ind)]
669669
low._sharedmask = False
670670
ind[axis] = h
671-
high = asorted[ind]
671+
high = asorted[tuple(ind)]
672672
# duplicate high if odd number of elements so mean does nothing
673673
odd = counts % 2 == 1
674674
if asorted.ndim == 1:

0 commit comments

Comments
 (0)
0