Skip to content

Commit 0ff69a1

Browse files
committed
simplify
1 parent 1bf6371 commit 0ff69a1

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
@@ -2095,12 +2095,12 @@ def equals(self, other):
20952095
if self.is_dtype_equal(other):
20962096
if self.categories.equals(other.categories):
20972097
# fastpath to avoid re-coding
2098-
return np.array_equal(self._codes, other._codes)
2098+
other_codes = other._codes
20992099
else:
2100-
# coerce their codes to ours
2101-
codes2 = _recode_for_categories(other.codes, other.categories,
2102-
self.categories)
2103-
return np.array_equal(self._codes, codes2)
2100+
other_codes = _recode_for_categories(other.codes,
2101+
other.categories,
2102+
self.categories)
2103+
return np.array_equal(self._codes, other_codes)
21042104
return False
21052105

21062106
def is_dtype_equal(self, other):

0 commit comments

Comments
 (0)