当前位置: 首页>>代码示例>>Python>>正文


Python merge._get_join_indexers方法代码示例

本文整理汇总了Python中pandas.core.reshape.merge._get_join_indexers方法的典型用法代码示例。如果您正苦于以下问题:Python merge._get_join_indexers方法的具体用法?Python merge._get_join_indexers怎么用?Python merge._get_join_indexers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pandas.core.reshape.merge的用法示例。


在下文中一共展示了merge._get_join_indexers方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _join_non_unique

# 需要导入模块: from pandas.core.reshape import merge [as 别名]
# 或者: from pandas.core.reshape.merge import _get_join_indexers [as 别名]
def _join_non_unique(self, other, how='left', return_indexers=False):
        from pandas.core.reshape.merge import _get_join_indexers

        left_idx, right_idx = _get_join_indexers([self._ndarray_values],
                                                 [other._ndarray_values],
                                                 how=how,
                                                 sort=True)

        left_idx = ensure_platform_int(left_idx)
        right_idx = ensure_platform_int(right_idx)

        join_index = np.asarray(self._ndarray_values.take(left_idx))
        mask = left_idx == -1
        np.putmask(join_index, mask, other._ndarray_values.take(right_idx))

        join_index = self._wrap_joined_index(join_index, other)

        if return_indexers:
            return join_index, left_idx, right_idx
        else:
            return join_index 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:23,代码来源:base.py

示例2: _join_non_unique

# 需要导入模块: from pandas.core.reshape import merge [as 别名]
# 或者: from pandas.core.reshape.merge import _get_join_indexers [as 别名]
def _join_non_unique(self, other, how='left', return_indexers=False):
        from pandas.core.reshape.merge import _get_join_indexers

        left_idx, right_idx = _get_join_indexers([self._ndarray_values],
                                                 [other._ndarray_values],
                                                 how=how,
                                                 sort=True)

        left_idx = _ensure_platform_int(left_idx)
        right_idx = _ensure_platform_int(right_idx)

        join_index = np.asarray(self._ndarray_values.take(left_idx))
        mask = left_idx == -1
        np.putmask(join_index, mask, other._ndarray_values.take(right_idx))

        join_index = self._wrap_joined_index(join_index, other)

        if return_indexers:
            return join_index, left_idx, right_idx
        else:
            return join_index 
开发者ID:birforce,项目名称:vnpy_crypto,代码行数:23,代码来源:base.py

示例3: _join_non_unique

# 需要导入模块: from pandas.core.reshape import merge [as 别名]
# 或者: from pandas.core.reshape.merge import _get_join_indexers [as 别名]
def _join_non_unique(self, other, how='left', return_indexers=False):
        from pandas.core.reshape.merge import _get_join_indexers

        left_idx, right_idx = _get_join_indexers([self._values],
                                                 [other._values], how=how,
                                                 sort=True)

        left_idx = _ensure_platform_int(left_idx)
        right_idx = _ensure_platform_int(right_idx)

        join_index = np.asarray(self._values.take(left_idx))
        mask = left_idx == -1
        np.putmask(join_index, mask, other._values.take(right_idx))

        join_index = self._wrap_joined_index(join_index, other)

        if return_indexers:
            return join_index, left_idx, right_idx
        else:
            return join_index 
开发者ID:nccgroup,项目名称:Splunking-Crime,代码行数:22,代码来源:base.py


注:本文中的pandas.core.reshape.merge._get_join_indexers方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。