Skip to content

Commit 5d54149

Browse files
committed
Fix _logical_method to return NotImplemented for non-1D operands instead of raising
1 parent 89c7ff3 commit 5d54149

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/core/arrays/boolean.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ def _logical_method(self, other, op): # type: ignore[override]
379379
elif is_list_like(other):
380380
other = np.asarray(other, dtype="bool")
381381
if other.ndim > 1:
382-
raise NotImplementedError("can only perform ops with 1-d structures")
382+
return NotImplemented
383383
other, mask = coerce_to_array(other, copy=False)
384384
elif isinstance(other, np.bool_):
385385
other = other.item()

0 commit comments

Comments
 (0)