

def symmetric_difference(self, other, result_name=None):
    "\n        Compute the sorted symmetric difference of two Index objects.\n\n        Parameters\n        ----------\n        other : Index or array-like\n        result_name : str\n\n        Returns\n        -------\n        symmetric_difference : Index\n\n        Notes\n        -----\n        ``symmetric_difference`` contains elements that appear in either\n        ``idx1`` or ``idx2`` but not both. Equivalent to the Index created by\n        ``(idx1 - idx2) + (idx2 - idx1)`` with duplicates dropped.\n\n        The sorting of a result containing ``NaN`` values is not guaranteed\n        across Python versions. See GitHub issue #6444.\n\n        Examples\n        --------\n        >>> idx1 = Index([1, 2, 3, 4])\n        >>> idx2 = Index([2, 3, 4, 5])\n        >>> idx1.symmetric_difference(idx2)\n        Int64Index([1, 5], dtype='int64')\n\n        You can also use the ``^`` operator:\n\n        >>> idx1 ^ idx2\n        Int64Index([1, 5], dtype='int64')\n        "
    self._assert_can_do_setop(other)
    (other, result_name_update) = self._convert_can_do_setop(other)
    if (result_name is None):
        result_name = result_name_update
    the_diff = sorted(set(self.difference(result_name_update).union(other.difference(self))))
    attribs = self._get_attributes_dict()
    attribs['name'] = result_name
    if ('freq' in attribs):
        attribs['freq'] = None
    return self._shallow_copy_with_infer(the_diff, **attribs)

dataset/ETHPy150Open pydata/pandas/pandas/indexes/base.py Index.symmetric_difference/VarMisuse@62/448 `other`->`result_name_update`