diff --git a/pandas/tests/frame/methods/test_equals.py b/pandas/tests/frame/methods/test_equals.py index ed135466628c1..04153e095764f 100644 --- a/pandas/tests/frame/methods/test_equals.py +++ b/pandas/tests/frame/methods/test_equals.py @@ -15,6 +15,16 @@ def test_dataframe_not_equal(self): df2 = DataFrame({"a": ["s", "d"], "b": [1, 2]}) assert df1.equals(df2) is False + def test_equals_object_array_vs_scalar(self): + # GH#43867 one object-dtype element is a numpy array, the other a + # scalar; these must not compare equal + df = DataFrame({"x": ["a"]}, dtype=object) + other = df.copy() + other["x"] = [np.array(["a"], dtype=object)] + assert df["x"].dtype == other["x"].dtype == object + assert not df.equals(other) + assert not other.equals(df) + def test_equals_different_blocks(self): # GH#9330 df0 = DataFrame(