Index.
intersection
Form the intersection of two Index objects.
This returns a new Index with elements common to the index and other.
Examples
>>> idx1 = ps.Index([1, 2, 3, 4]) >>> idx2 = ps.Index([3, 4, 5, 6]) >>> idx1.intersection(idx2).sort_values() Int64Index([3, 4], dtype='int64')