pandas.Index.symmetric_difference

pandas 3.1.1 · Index objects · method

Get labels occurring in exactly one of the two index collections.

Call syntax

Index.symmetric_difference(other, result_name=None, sort=None)

Run the example

Edit the example and select Run Python to see the result.

Parameters

ParameterRequirementAccepted values and behavior
other Required
Positional or keyword
Index or array-like

Supply the second object or value used in the operation.

result_name Optional
Positional or keyword
Default None
str
sort Optional
Positional or keyword
Default None
bool or None

Choose whether the resulting labels or groups are sorted where supported.

Returns

Index