diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2018-02-16 21:36:38 -0800 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2018-02-16 22:23:51 -0800 |
commit | e441c291b2e10c8de85a9d950d0add552d0ebd83 (patch) | |
tree | e407fc2b65b888c13f17bcb1e2654f990c2932b2 /numpy/ma/extras.py | |
parent | 5c5a215fa1101479ae9b8d127be32679c9f3f105 (diff) | |
download | numpy-e441c291b2e10c8de85a9d950d0add552d0ebd83.tar.gz |
MAINT: Stop using non-tuple indices internally
By not using this type of indexing, it becomes easier for subclasses to override indexing in a way that works correctly with numpy functions.
These locations were found by deprecating the behavior in question, which is deliberately not part of this commit
Diffstat (limited to 'numpy/ma/extras.py')
-rw-r--r-- | numpy/ma/extras.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/numpy/ma/extras.py b/numpy/ma/extras.py index 99f5234d1..e247fe170 100644 --- a/numpy/ma/extras.py +++ b/numpy/ma/extras.py @@ -724,6 +724,7 @@ def _median(a, axis=None, out=None, overwrite_input=False): # as median (which is mean of empty slice = nan) indexer = [slice(None)] * asorted.ndim indexer[axis] = slice(0, 0) + indexer = tuple(indexer) return np.ma.mean(asorted[indexer], axis=axis, out=out) if asorted.ndim == 1: @@ -1716,7 +1717,7 @@ def notmasked_contiguous(a, axis=None): # for i in range(a.shape[other]): idx[other] = i - result.append(flatnotmasked_contiguous(a[idx]) or None) + result.append(flatnotmasked_contiguous(a[tuple(idx)]) or None) return result |