def _join_monotonic(self, other, how='left', return_indexers=False): this_vals = self.values if self.dtype != other.dtype: other = Index(other, dtype=object) other_vals = other.values if how == 'left': join_index = self lidx = None ridx = lib.left_join_indexer_object(self, other) elif how == 'right': join_index = other lidx = lib.left_join_indexer_object(other, self) ridx = None elif how == 'inner': join_index, lidx, ridx = lib.inner_join_indexer_object(this_vals, other_vals) join_index = self._wrap_joined_index(join_index, other) elif how == 'outer': join_index, lidx, ridx = lib.outer_join_indexer_object(this_vals, other_vals) join_index = self._wrap_joined_index(join_index, other) else: # pragma: no cover raise Exception('do not recognize join method %s' % how) if return_indexers: return join_index, lidx, ridx else: return join_index
def _join_monotonic(self, other, how="left", return_indexers=False): if how == "left": join_index = self lidx = None ridx = lib.left_join_indexer_object(self, other) elif how == "right": join_index = other lidx = lib.left_join_indexer_object(other, self) ridx = None elif how == "inner": join_index, lidx, ridx = lib.inner_join_indexer_object(self, other) join_index = Index(join_index) elif how == "outer": join_index, lidx, ridx = lib.outer_join_indexer_object(self, other) join_index = Index(join_index) else: # pragma: no cover raise Exception("do not recognize join method %s" % how) if return_indexers: return join_index, lidx, ridx else: return join_index