From aa71c506a68744c1ef033653f82d243ddcd845f6 Mon Sep 17 00:00:00 2001 From: y-p Date: Sat, 10 Nov 2012 01:25:39 +0200 Subject: [PATCH] BUG: coerce ndarray dtype to object when comparing series fixes #1926 (partialy at least) --- pandas/core/series.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pandas/core/series.py b/pandas/core/series.py index 4194cbd4e4156..b6e1448514112 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -110,7 +110,10 @@ def na_op(x, y): y = lib.list_to_object_array(y) if isinstance(y, np.ndarray): - result = lib.vec_compare(x, y, op) + if y.dtype != np.object_: + result = lib.vec_compare(x, y.astype(np.object_), op) + else: + result = lib.vec_compare(x, y, op) else: result = lib.scalar_compare(x, y, op) else: