We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
numfocus
Learn more about funding links in repositories.
Report abuse
There was an error while loading. Please reload this page.
1 parent 49ad754 commit 21d39b5Copy full SHA for 21d39b5
pandas/core/indexes/range.py
@@ -308,12 +308,12 @@ def has_duplicates(self):
308
309
@Appender(_index_shared_docs['get_loc'])
310
def get_loc(self, key, method=None, tolerance=None):
311
- if method is None and tolerance is None:
+ if is_integer(key) and method is None and tolerance is None:
312
try:
313
return self._range.index(key)
314
except ValueError:
315
raise KeyError(key)
316
- return super().__get_loc(key, method=method, tolerance=tolerance)
+ return super().get_loc(key, method=method, tolerance=tolerance)
317
318
def tolist(self):
319
return list(range(self._start, self._stop, self._step))
0 commit comments