databricks.koalas.Index.intersection¶
-
Index.
intersection
(other) → databricks.koalas.indexes.base.Index[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 = ks.Index([1, 2, 3, 4]) >>> idx2 = ks.Index([3, 4, 5, 6]) >>> idx1.intersection(idx2).sort_values() Int64Index([3, 4], dtype='int64')