pandas.Index.intersection

Index.intersection(other)[source]

形成两个Index对象。

这将返回一个包含索引和其他的常用元素的新索引。不保证结果的排序。

参数:其他:索引或数组类
返回:intersection:索引

例子

>>> idx1 = pd.Index([1, 2, 3, 4])
>>> idx2 = pd.Index([3, 4, 5, 6])
>>> idx1.intersection(idx2)
Int64Index([3, 4], dtype='int64')
Scroll To Top