Skip to content

Commit bb906bb

Browse files
committed
Converting ^ to != for logical xor
1 parent d97c837 commit bb906bb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pandas/core/arrays/arrow/array.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def cast_for_logical(x, y):
117117
is_x_bool = pa.types.is_boolean(x.type)
118118
is_y_bool = pa.types.is_boolean(y.type)
119119

120-
if (is_x_bool ^ is_y_bool):
120+
if (is_x_bool != is_y_bool):
121121
return convert_string_to_boolean_array(x), convert_string_to_boolean_array(y)
122122
return x, y
123123

@@ -838,7 +838,7 @@ def _evaluate_op_method(self, other, op, arrow_funcs) -> Self:
838838
raise TypeError(self._op_method_error_message(other_original, op)) from err
839839

840840
if (op.__name__ in ARROW_LOGICAL_FUNCS
841-
and (isinstance(self, pa.lib.BooleanArray) ^
841+
and (isinstance(self, pa.lib.BooleanArray) !=
842842
isinstance(other, pa.lib.BooleanArray))
843843
):
844844
return pc.cast(result, pa.bool_())

0 commit comments

Comments
 (0)