Skip to content

CLN: remove no-op from indexing #30934

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 2 commits into from
Jan 13, 2020
Merged
Changes from all commits
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
8 changes: 1 addition & 7 deletions pandas/core/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1340,9 +1340,6 @@ def _multi_take(self, tup: Tuple):
}
return o._reindex_with_indexers(d, copy=True, allow_dups=True)

def _convert_for_reindex(self, key, axis: int):
return key

def _handle_lowerdim_multi_index_axis0(self, tup: Tuple):
# we have an axis0 multi-index, handle or raise
axis = self.axis or 0
Expand Down Expand Up @@ -1539,10 +1536,6 @@ def _get_listlike_indexer(self, key, axis: int, raise_missing: bool = False):
return ax[indexer], indexer

if ax.is_unique and not getattr(ax, "is_overlapping", False):
# If we are trying to get actual keys from empty Series, we
# patiently wait for a KeyError later on - otherwise, convert
if len(ax) or not len(key):
key = self._convert_for_reindex(key, axis)
indexer = ax.get_indexer_for(key)
keyarr = ax.reindex(keyarr)[0]
else:
Expand Down Expand Up @@ -1757,6 +1750,7 @@ def __getitem__(self, key):
try:
return self._getitem_scalar(key)
except (KeyError, IndexError, AttributeError):
# AttributeError for IntervalTree get_value
pass
return self._getitem_tuple(key)
else:
Expand Down