MultiIndex.
intersection
Form the intersection of two Index objects.
This returns a new Index with elements common to the index and other.
Examples
>>> midx1 = ps.MultiIndex.from_tuples([("a", "x"), ("b", "y"), ("c", "z")]) >>> midx2 = ps.MultiIndex.from_tuples([("c", "z"), ("d", "w")]) >>> midx1.intersection(midx2).sort_values() MultiIndex([('c', 'z')], )