8000 REF: implement Index._get_indexer by jbrockmendel · Pull Request #38308 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

REF: implement Index._get_indexer #38308

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 8, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
REF: move check up
  • Loading branch information
jbrockmendel committed Dec 5, 2020
commit 36608d362021364fb1d6a510eeae8996a74d50f9
15 changes: 8 additions & 7 deletions pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3144,13 +3144,6 @@ def get_indexer(

method = missing.clean_reindex_fill_method(method)
target = ensure_index(target)
return self._get_indexer(target, method, limit, tolerance)

def _get_indexer(
self, target: "Index", method=None, limit=None, tolerance=None
) -> np.ndarray:
if tolerance is not None:
tolerance = self._convert_tolerance(tolerance, target)

# Treat boolean labels passed to a numeric index as not found. Without
# this fix False and True would be treated as 0 and 1 respectively.
Expand All @@ -3164,6 +3157,14 @@ def _get_indexer(
ptarget, method=method, limit=limit, tolerance=tolerance
)

return self._get_indexer(target, method, limit, tolerance)

def _get_indexer(
self, target: "Index", method=None, limit=None, tolerance=None
) -> np.ndarray:
if tolerance is not None:
tolerance = self._convert_tolerance(tolerance, target)

if not is_dtype_equal(self.dtype, target.dtype):
this = self.astype(object)
target = target.astype(object)
Expand Down
0