diff options
Diffstat (limited to 'numpy/lib/function_base.py')
-rw-r--r-- | numpy/lib/function_base.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py index 257057666..3074a2f70 100644 --- a/numpy/lib/function_base.py +++ b/numpy/lib/function_base.py @@ -3763,7 +3763,9 @@ def insert(arr, obj, values, axis=None): if (index < 0): index += N - values = array(values, copy=False, ndmin=arr.ndim) + # There are some object array corner cases here, but we cannot avoid + # that: + values = array(values, copy=False, ndmin=arr.ndim, dtype=arr.dtype) if indices.ndim == 0: # broadcasting is very different here, since a[:,0,:] = ... behaves # very different from a[:,[0],:] = ...! This changes values so that |