MCPcopy
hub / github.com/numpy/numpy / test_isin_mixed_boolean

Method test_isin_mixed_boolean

numpy/lib/tests/test_arraysetops.py:463–473  ·  view source on GitHub ↗

Test that isin works as expected for bool/int input.

(self, kind)

Source from the content-addressed store, hash-verified

461
462 @pytest.mark.parametrize("kind", [None, "sort", "table"])
463 def test_isin_mixed_boolean(self, kind):
464 """Test that isin works as expected for bool/int input."""
465 for dtype in np.typecodes["AllInteger"]:
466 a = np.array([True, False, False], dtype=bool)
467 b = np.array([0, 0, 0, 0], dtype=dtype)
468 expected = np.array([False, True, True], dtype=bool)
469 assert_array_equal(isin(a, b, kind=kind), expected)
470
471 a, b = b, a
472 expected = np.array([True, True, True, True], dtype=bool)
473 assert_array_equal(isin(a, b, kind=kind), expected)
474
475 def test_isin_first_array_is_object(self):
476 ar1 = [None]

Callers

nothing calls this directly

Calls 2

assert_array_equalFunction · 0.90
isinFunction · 0.90

Tested by

no test coverage detected