Skip to content

Commit aa71c50

Browse files
author
y-p
committed
BUG: coerce ndarray dtype to object when comparing series
fixes #1926 (partialy at least)
1 parent 5d5bda6 commit aa71c50

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pandas/core/series.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,10 @@ def na_op(x, y):
110110
y = lib.list_to_object_array(y)
111111

112112
if isinstance(y, np.ndarray):
113-
result = lib.vec_compare(x, y, op)
113+
if y.dtype != np.object_:
114+
result = lib.vec_compare(x, y.astype(np.object_), op)
115+
else:
116+
result = lib.vec_compare(x, y, op)
114117
else:
115118
result = lib.scalar_compare(x, y, op)
116119
else:

0 commit comments

Comments
 (0)