summaryrefslogtreecommitdiff
path: root/numpy/ma/extras.py
diff options
context:
space:
mode:
authorAmit Aronovitch <aronovitch@gmail.com>2016-05-19 03:29:50 +0300
committerAmit Aronovitch <aronovitch@gmail.com>2016-05-22 00:05:18 +0300
commita4cc361003d3b2b241b826372d9691187b47f86f (patch)
tree8ffed1b54140e1e6cadeace9d63ad0e9a475ae03 /numpy/ma/extras.py
parentbb46a495ee5201fb94c14776f41181343e5b7fb2 (diff)
downloadnumpy-a4cc361003d3b2b241b826372d9691187b47f86f.tar.gz
STY: ma.extras.median: avoid indexing with list
Recommended type for nd-indexing is a tuple. See #4434
Diffstat (limited to 'numpy/ma/extras.py')
-rw-r--r--numpy/ma/extras.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/ma/extras.py b/numpy/ma/extras.py
index 2a44397d7..781b25449 100644
--- a/numpy/ma/extras.py
+++ b/numpy/ma/extras.py
@@ -665,10 +665,10 @@ def _median(a, axis=None, out=None, overwrite_input=False):
ind = np.meshgrid(*axes_grid, sparse=True, indexing='ij')
# insert indices of low and high median
ind.insert(axis, h - 1)
- low = asorted[ind]
+ low = asorted[tuple(ind)]
low._sharedmask = False
ind[axis] = h
- high = asorted[ind]
+ high = asorted[tuple(ind)]
# duplicate high if odd number of elements so mean does nothing
odd = counts % 2 == 1
if asorted.ndim == 1: