diff options
author | Félix Hartmann <felix.hartmann@crans.org> | 2013-07-03 00:16:58 +0200 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2013-08-02 14:36:23 -0600 |
commit | cb6fe848bf1a6a046fd473b72b1350ea40c8644e (patch) | |
tree | 0df0e1e2599cb6f6b488cd8693a09a9475d0fa6b /numpy/lib/function_base.py | |
parent | 196398fadb7fe402a67ccea0bc1546b36d066440 (diff) | |
download | numpy-cb6fe848bf1a6a046fd473b72b1350ea40c8644e.tar.gz |
BUG: Fix bug in np.insert when axis=-1
Diffstat (limited to 'numpy/lib/function_base.py')
-rw-r--r-- | numpy/lib/function_base.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py index 5e433d3ab..9f1757d7c 100644 --- a/numpy/lib/function_base.py +++ b/numpy/lib/function_base.py @@ -3742,7 +3742,7 @@ def insert(arr, obj, values, axis=None): # broadcasting is very different here, since a[:,0,:] = ... behaves # very different from a[:,[0],:] = ...! This changes values so that # it works likes the second case. (here a[:,0:1,:]) - values = np.rollaxis(values, 0, axis+1) + values = np.rollaxis(values, 0, axis % ndim + 1) numnew = values.shape[axis] newshape[axis] += numnew new = empty(newshape, arr.dtype, arr.flags.fnc) |