-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
PERF: RangeIndex.get_loc #30930
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
PERF: RangeIndex.get_loc #30930
Conversation
except ValueError: | ||
raise KeyError(key) | ||
if method is None and tolerance is None: | ||
if is_integer(key) or (is_float(key) and key.is_integer()): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the extra condition here imply any behavioral changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, intlike floats go through here now instead of going through the _maybe_cast_indexer path in Index.get_loc.
How does this change affect |
Typo, will update title |
The timings you showed were then also not relevant? |
Huh, not sure how that happened. Will update with get_loc timings, which make a much bigger difference:
|
That looks better :) |
thanks @jbrockmendel |
Small simplification gives a small speedup