summaryrefslogtreecommitdiff
path: root/numpy/lib/tests
diff options
context:
space:
mode:
authorDevin Shanahan <dshanahan88@gmail.com>2022-01-16 05:14:04 -0700
committerDevin Shanahan <dshanahan88@gmail.com>2022-01-16 05:14:04 -0700
commit3c81e3020a5b65c1590fc73a53ee9193a2c8b224 (patch)
tree0cb15f201a06626e1abf516177a0b9cf1ddba668 /numpy/lib/tests
parent0f66b6032a2c5039007d5041398561b452ddabef (diff)
downloadnumpy-3c81e3020a5b65c1590fc73a53ee9193a2c8b224.tar.gz
MAINT: single value identification and test
Diffstat (limited to 'numpy/lib/tests')
-rw-r--r--numpy/lib/tests/test_function_base.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py
index b67a31b18..874754a64 100644
--- a/numpy/lib/tests/test_function_base.py
+++ b/numpy/lib/tests/test_function_base.py
@@ -890,6 +890,19 @@ class TestDelete:
with pytest.raises(IndexError):
np.delete([0, 1, 2], np.array([], dtype=float))
+ def test_single_item_array(self):
+ a_del = delete(self.a, 1)
+ a_del_arr = delete(self.a, np.array([1]))
+ a_del_lst = delete(self.a, [1])
+ a_del_obj = delete(self.a, np.array([1], dtype=object))
+ assert_equal(a_del, a_del_arr, a_del_lst, a_del_obj)
+
+ nd_a_del = delete(self.nd_a, 1, axis=1)
+ nd_a_del_arr = delete(self.nd_a, np.array([1]), axis=1)
+ nd_a_del_lst = delete(self.nd_a, [1], axis=1)
+ nd_a_del_obj = delete(self.nd_a, np.array([1], dtype=object), axis=1)
+ assert_equal(nd_a_del, nd_a_del_arr, nd_a_del_lst, nd_a_del_obj)
+
class TestGradient: