diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2017-12-11 22:33:00 -0800 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2017-12-11 22:33:00 -0800 |
commit | e7d571396e92b670a0e8de6e50366ba1dbee3c6e (patch) | |
tree | 2dfefcaab727c55a7526cf4d516a33dff635a19b /numpy/lib/index_tricks.py | |
parent | d4bc1b6795912391473a56f6e757e39bd7b63676 (diff) | |
download | numpy-e7d571396e92b670a0e8de6e50366ba1dbee3c6e.tar.gz |
BUG: Fix mutating state between items in np,r_
It's not at all clear what trans1d is supposed to do here, but it's certainly not supposed to change value between elements!
Diffstat (limited to 'numpy/lib/index_tricks.py')
-rw-r--r-- | numpy/lib/index_tricks.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/numpy/lib/index_tricks.py b/numpy/lib/index_tricks.py index b2c178f10..43fdc5627 100644 --- a/numpy/lib/index_tricks.py +++ b/numpy/lib/index_tricks.py @@ -316,10 +316,10 @@ class AxisConcatenator(object): newobj = array(item, copy=False, subok=True, ndmin=ndmin) if trans1d != -1 and item_ndim < ndmin: k2 = ndmin - item_ndim - if (trans1d < 0): - trans1d += k2 + 1 - defaxes = list(range(ndmin)) k1 = trans1d + if k1 < 0: + k1 += k2 + 1 + defaxes = list(range(ndmin)) axes = defaxes[:k1] + defaxes[k2:] + defaxes[k1:k2] newobj = newobj.transpose(axes) objs.append(newobj) |