pandas.Index.intersection

pandas 3.1.1 · Index objects · method

Get the labels shared with another index or collection.

Call syntax

Index.intersection(other, sort=False)

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.

sort Optional
Positional or keyword
Default False
True, False or None

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

Returns

Index