def equals(self, other):
if self.is_dtype_equal(other):<EOL><INDENT>if self.categories.equals(other.categories):<EOL><INDENT>other_codes = other._codes<EOL><DEDENT>else:<EOL><INDENT>other_codes = _recode_for_categories(other.codes,<EOL>other.categories,<EOL>self.categories)<EOL><DEDENT>return np.array_equal(self._codes, other_codes)<EOL><DEDENT>return False<EOL>
Returns True if categorical arrays are equal.

Parameters
----------
other : `Categorical`

Returns
-------
bool