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

Method test_in1d_mixed_boolean

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

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

(self, kind)

Source from the content-addressed store, hash-verified

451
452 @pytest.mark.parametrize("kind", [None, "sort", "table"])
453 def test_in1d_mixed_boolean(self, kind):
454 """Test that in1d works as expected for bool/int input."""
455 for dtype in np.typecodes["AllInteger"]:
456 a = np.array([True, False, False], dtype=bool)
457 b = np.array([0, 0, 0, 0], dtype=dtype)
458 expected = np.array([False, True, True], dtype=bool)
459 assert_array_equal(in1d(a, b, kind=kind), expected)
460
461 a, b = b, a
462 expected = np.array([True, True, True, True], dtype=bool)
463 assert_array_equal(in1d(a, b, kind=kind), expected)
464
465 def test_in1d_first_array_is_object(self):
466 ar1 = [None]

Callers

nothing calls this directly

Calls 2

assert_array_equalFunction · 0.90
in1dFunction · 0.90

Tested by

no test coverage detected