Skip to content

Commit 60c156e

Browse files
committed
Merge branch 'my-first-branch' of https://github.com/ryanreh99/pandas into my-first-branch
2 parents 822105d + 682c35d commit 60c156e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pandas/core/indexes/base.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2874,6 +2874,10 @@ def _convert_scalar_indexer(self, key, kind=None):
28742874

28752875
elif kind in ['loc'] and is_integer(key):
28762876
if not self.holds_integer():
2877+
try:
2878+
self._engine.get_loc(self._maybe_cast_indexer(key))
2879+
except KeyError:
2880+
return key
28772881
return self._invalid_indexer('label', key)
28782882

28792883
return key

0 commit comments

Comments
 (0)