def equals(self, other):
        return (self.is_dtype_equal(other) and
                np.array_equal(self._codes, other._codes))
Returns True if categorical arrays are equal.
dataset/ETHPy150Open pydata/pandas/pandas/core/categorical.py/Categorical.equals