def equals(self, other):
    '\n        Returns True if categorical arrays are equal.\n\n        Parameters\n        ----------\n        other : `Categorical`\n\n        Returns\n        -------\n        are_equal : boolean\n        '
    if self.is_dtype_equal(other):
        if self.categories.equals(other.categories):
            other_codes = other._codes
        else:
            other_codes = _recode_for_categories(other.codes, other.categories, self.categories)
        return np.array_equal(self._codes, other_codes)
    return False
Returns True if categorical arrays are equal.

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

Returns
-------
are_equal : boolean
def equals(self, other):
    '\n        Returns True if categorical arrays are equal.\n\n        Parameters\n        ----------\n        other : `Categorical`\n\n        Returns\n        -------\n        are_equal : boolean\n        '
    if self.is_dtype_equal(other):
        if self.categories.equals(other.categories):
            other_codes = other._codes
        else:
            other_codes = _recode_for_categories(other.codes, other.categories, self.categories)
        return np.array_equal(self._codes, other_codes)
    return False