We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1bf6371 commit 0ff69a1Copy full SHA for 0ff69a1
pandas/core/categorical.py
@@ -2095,12 +2095,12 @@ def equals(self, other):
2095
if self.is_dtype_equal(other):
2096
if self.categories.equals(other.categories):
2097
# fastpath to avoid re-coding
2098
- return np.array_equal(self._codes, other._codes)
+ other_codes = other._codes
2099
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)
+ other_codes = _recode_for_categories(other.codes,
+ other.categories,
+ self.categories)
+ return np.array_equal(self._codes, other_codes)
2104
return False
2105
2106
def is_dtype_equal(self, other):
0 commit comments