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>try:<EOL><INDENT>if not isinstance(other, Float64Index):<EOL><INDENT>other = self._constructor(other)<EOL><DEDENT>if (not is_dtype_equal(self.dtype, other.dtype) or<EOL>self.shape != other.shape):<EOL><INDENT>return False<EOL><DEDENT>left, right = self._ndarray_values, other._ndarray_values<EOL>return ((left == right) | (self._isnan & other._isnan)).all()<EOL><DEDENT>except (TypeError, ValueError):<EOL><INDENT>return False<EOL><DEDENT>
Determines if two Index objects contain the same elements.