databricks.koalas.MultiIndex.intersection

MultiIndex.intersection(other) → databricks.koalas.indexes.multi.MultiIndex[source]

Form the intersection of two Index objects.

This returns a new Index with elements common to the index and other.

Parameters
otherIndex or array-like
Returns
intersectionMultiIndex

Examples

>>> midx1 = ks.MultiIndex.from_tuples([("a", "x"), ("b", "y"), ("c", "z")])
>>> midx2 = ks.MultiIndex.from_tuples([("c", "z"), ("d", "w")])
>>> midx1.intersection(midx2).sort_values()  
MultiIndex([('c', 'z')],
           )