MCPcopy Create free account
hub / github.com/numpy/numpy / test_intersect1d_array_like

Method test_intersect1d_array_like

numpy/lib/tests/test_arraysetops.py:34–44  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

32 assert_array_equal([], intersect1d([], []))
33
34 def test_intersect1d_array_like(self):
35 # See gh-11772
36 class Test:
37 def __array__(self):
38 return np.arange(3)
39
40 a = Test()
41 res = intersect1d(a, a)
42 assert_array_equal(res, a)
43 res = intersect1d([1, 2, 3], [1, 2, 3])
44 assert_array_equal(res, [1, 2, 3])
45
46 def test_intersect1d_indices(self):
47 # unique inputs

Callers

nothing calls this directly

Calls 3

intersect1dFunction · 0.90
assert_array_equalFunction · 0.90
TestClass · 0.70

Tested by

no test coverage detected