Skip to content

Commit 45e1df0

Browse files
committed
Wrap the func inside _cat_compare_op
1 parent c17322e commit 45e1df0

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

pandas/core/arrays/categorical.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,14 @@
5353
Use 'allow_fill=False' to accept the new behavior.""")
5454

5555

56-
@CompWrapper(inst_from_senior_cls=True, zerodim=True)
5756
def _cat_compare_op(op):
57+
@CompWrapper(inst_from_senior_cls=True, zerodim=True)
5858
def f(self, other):
5959
# On python2, you can usually compare any type to any type, and
6060
# Categoricals can be seen as a custom type, but having different
6161
# results depending whether categories are the same or not is kind of
6262
# insane, so be a bit stricter here and use the python3 idea of
6363
# comparing only things of equal type.
64-
if isinstance(other, (ABCDataFrame, ABCSeries, ABCIndexClass)):
65-
return NotImplemented
66-
67-
other = lib.item_from_zerodim(other)
68-
6964
if not self.ordered:
7065
if op in ['__lt__', '__gt__', '__le__', '__ge__']:
7166
raise TypeError("Unordered Categoricals can only compare "

0 commit comments

Comments
 (0)