Skip to content

Commit 930a267

Browse files
y-pwesm
y-p
authored andcommitted
BUG: coerce ndarray dtype to object when comparing series
fixes #1926 (partialy at least)
1 parent 48df7c3 commit 930a267

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)