We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9106f09 commit da86c02Copy full SHA for da86c02
pandas/core/categorical.py
@@ -2084,12 +2084,12 @@ def equals(self, other):
2084
if self.is_dtype_equal(other):
2085
if self.categories.equals(other.categories):
2086
# fastpath to avoid re-coding
2087
- return np.array_equal(self._codes, other._codes)
+ other_codes = other._codes
2088
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)
+ other_codes = _recode_for_categories(other.codes,
+ other.categories,
+ self.categories)
+ return np.array_equal(self._codes, other_codes)
2093
return False
2094
2095
def is_dtype_equal(self, other):
0 commit comments