Skip to content

Commit

Permalink
BUG: Fix bug in np.insert when axis=-1
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixHartmann authored and charris committed Aug 2, 2013
1 parent 196398f commit cb6fe84
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion numpy/lib/function_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit cb6fe84

Please sign in to comment.