summaryrefslogtreecommitdiff
path: root/numpy/lib/function_base.py
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2020-03-22 14:20:33 +0000
committerEric Wieser <wieser.eric@gmail.com>2020-03-22 14:36:42 +0000
commit03aa7f92b95d3c9ce7230d98664984a663bac0af (patch)
treecaca6d41a296c40a6c325398e917a140f54ef37f /numpy/lib/function_base.py
parent5134132ae9cc9c3fba1d5420353277cf3d96eb90 (diff)
downloadnumpy-03aa7f92b95d3c9ce7230d98664984a663bac0af.tar.gz
MAINT: Add an explanatory comment for some weird code
Diffstat (limited to 'numpy/lib/function_base.py')
-rw-r--r--numpy/lib/function_base.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py
index b9f3bbb16..e68b9f2ef 100644
--- a/numpy/lib/function_base.py
+++ b/numpy/lib/function_base.py
@@ -4270,6 +4270,7 @@ def delete(arr, obj, axis=None):
if axis is None:
if ndim != 1:
arr = arr.ravel()
+ # needed for np.matrix, which is still not 1d after being ravelled
ndim = arr.ndim
axis = -1
@@ -4510,6 +4511,7 @@ def insert(arr, obj, values, axis=None):
if axis is None:
if ndim != 1:
arr = arr.ravel()
+ # needed for np.matrix, which is still not 1d after being ravelled
ndim = arr.ndim
axis = ndim - 1
elif ndim == 0: