Skip to content

Commit da86c02

Browse files
committed
simplify
1 parent 9106f09 commit da86c02

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pandas/core/categorical.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -2084,12 +2084,12 @@ def equals(self, other):
20842084
if self.is_dtype_equal(other):
20852085
if self.categories.equals(other.categories):
20862086
# fastpath to avoid re-coding
2087-
return np.array_equal(self._codes, other._codes)
2087+
other_codes = other._codes
20882088
else:
2089-
# coerce their codes to ours
2090-
codes2 = _recode_for_categories(other.codes, other.categories,
2091-
self.categories)
2092-
return np.array_equal(self._codes, codes2)
2089+
other_codes = _recode_for_categories(other.codes,
2090+
other.categories,
2091+
self.categories)
2092+
return np.array_equal(self._codes, other_codes)
20932093
return False
20942094

20952095
def is_dtype_equal(self, other):

0 commit comments

Comments
 (0)