-
Index.intersection(other)
[source] -
Form the intersection of two Index objects.
This returns a new Index with elements common to the index and
other
. Sortedness of the result is not guaranteed.Parameters: other : Index or array-like Returns: intersection : Index Examples
1234>>> idx1
=
pd.Index([
1
,
2
,
3
,
4
])
>>> idx2
=
pd.Index([
3
,
4
,
5
,
6
])
>>> idx1.intersection(idx2)
Int64Index([
3
,
4
], dtype
=
'int64'
)
Index.intersection()

2025-01-10 15:47:30
Please login to continue.