MCPcopy
hub / github.com/pandas-dev/pandas / test_object_comparison_2d

Function test_object_comparison_2d

pandas/tests/arithmetic/test_array_ops.py:29–41  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27
28
29def test_object_comparison_2d():
30 left = np.arange(9).reshape(3, 3).astype(object)
31 right = left.T
32
33 result = comparison_op(left, right, operator.eq)
34 expected = np.eye(3).astype(bool)
35 tm.assert_numpy_array_equal(result, expected)
36
37 # Ensure that cython doesn't raise on non-writeable arg, which
38 # we can get from np.broadcast_to
39 right.flags.writeable = False
40 result = comparison_op(left, right, operator.ne)
41 tm.assert_numpy_array_equal(result, ~expected)
42
43
44@pytest.mark.parametrize("rvalues", [1, [1, 1, 1], np.nan, None])

Callers

nothing calls this directly

Calls 3

comparison_opFunction · 0.90
astypeMethod · 0.45
reshapeMethod · 0.45

Tested by

no test coverage detected