pandas.Index.join #
- 最终 索引。join ( other , * , how = 'left' , level = None , return_indexers = False , sort = False ) [来源] #
计算 join_index 和索引器以使数据结构符合新索引。
- 参数:
- 其他索引
- 如何{'左','右','内','外'}
- level int 或级别名称,默认 None
- return_indexers bool, 默认 False
- 排序bool,默认 False
在结果索引中按字典顺序对连接键进行排序。如果为 False,则连接键的顺序取决于连接类型(how 关键字)。
- 返回:
- join_index, (左索引器, 右索引器)
例子
>>> idx1 = pd.Index([1, 2, 3]) >>> idx2 = pd.Index([4, 5, 6]) >>> idx1.join(idx2, how='outer') Index([1, 2, 3, 4, 5, 6], dtype='int64')