diff options
Diffstat (limited to 'numpy/lib/function_base.py')
-rw-r--r-- | numpy/lib/function_base.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py index 43bd3af8b..500394a38 100644 --- a/numpy/lib/function_base.py +++ b/numpy/lib/function_base.py @@ -3694,7 +3694,8 @@ def insert(arr, obj, values, axis=None): # turn it into a range object indices = arange(*obj.indices(N),**{'dtype':intp}) else: - indices = np.asarray(obj) + # need to copy obj, because indices will be changed in-place + indices = np.array(obj) if indices.dtype == bool: # See also delete warnings.warn("in the future insert will treat boolean arrays " |