pyspark.pandas.Index.intersection#
- Index.intersection(other)[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
- intersectionIndex
Examples
>>> idx1 = ps.Index([1, 2, 3, 4]) >>> idx2 = ps.Index([3, 4, 5, 6]) >>> idx1.intersection(idx2).sort_values() Index([3, 4], dtype='int64')