(self)
| 18 | class TestSetOps: |
| 19 | |
| 20 | def test_intersect1d(self): |
| 21 | # unique inputs |
| 22 | a = np.array([5, 7, 1, 2]) |
| 23 | b = np.array([2, 4, 3, 1, 5]) |
| 24 | |
| 25 | ec = np.array([1, 2, 5]) |
| 26 | c = intersect1d(a, b, assume_unique=True) |
| 27 | assert_array_equal(c, ec) |
| 28 | |
| 29 | # non-unique inputs |
| 30 | a = np.array([5, 5, 7, 1, 2]) |
| 31 | b = np.array([2, 1, 4, 3, 3, 1, 5]) |
| 32 | |
| 33 | ed = np.array([1, 2, 5]) |
| 34 | c = intersect1d(a, b) |
| 35 | assert_array_equal(c, ed) |
| 36 | assert_array_equal([], intersect1d([], [])) |
| 37 | |
| 38 | def test_intersect1d_array_like(self): |
| 39 | # See gh-11772 |
nothing calls this directly
no test coverage detected