We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8db5a5f commit cb3c8d6Copy full SHA for cb3c8d6
pandas/_libs/lib.pyx
@@ -584,6 +584,10 @@ def array_equivalent_object(left: object[:], right: object[:]) -> bool:
584
# Only compare scalars to scalars and arrays to arrays
585
elif cnp.PyArray_IsAnyScalar(x) != cnp.PyArray_IsAnyScalar(y):
586
return False
587
+ # Check if arrays have the same type
588
+ elif not (cnp.PyArray_IsPythonScalar(x) or cnp.PyArray_IsPythonScalar(y)) \
589
+ and not (isinstance(x, type(y)) or isinstance(y, type(x))):
590
+ return False
591
elif not (PyObject_RichCompareBool(x, y, Py_EQ) or
592
(x is None or is_nan(x)) and (y is None or is_nan(y))):
593
0 commit comments