def equals(self, other):
if self.is_(other):<EOL><INDENT>return True<EOL><DEDENT>if not isinstance(other, Index):<EOL><INDENT>return False<EOL><DEDENT>if not isinstance(other, MultiIndex):<EOL><INDENT>other_vals = com.values_from_object(ensure_index(other))<EOL>return array_equivalent(self._ndarray_values, other_vals)<EOL><DEDENT>if self.nlevels != other.nlevels:<EOL><INDENT>return False<EOL><DEDENT>if len(self) != len(other):<EOL><INDENT>return False<EOL><DEDENT>for i in range(self.nlevels):<EOL><INDENT>self_codes = self.codes[i]<EOL>self_codes = self_codes[self_codes != -<NUM_LIT:1>]<EOL>self_values = algos.take_nd(np.asarray(self.levels[i]._values),<EOL>self_codes, allow_fill=False)<EOL>other_codes = other.codes[i]<EOL>other_codes = other_codes[other_codes != -<NUM_LIT:1>]<EOL>other_values = algos.take_nd(<EOL>np.asarray(other.levels[i]._values),<EOL>other_codes, allow_fill=False)<EOL>if len(self_values) == <NUM_LIT:0> and len(other_values) == <NUM_LIT:0>:<EOL><INDENT>continue<EOL><DEDENT>if not array_equivalent(self_values, other_values):<EOL><INDENT>return False<EOL><DEDENT><DEDENT>return True<EOL>
Determines if two MultiIndex objects have the same labeling information
(the levels themselves do not necessarily have to be the same)

See Also
--------
equal_levels