-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
PERF/CLN: float-to-int casting #31409
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
Conversation
There should be a similar case in |
more cases in pandas/core/dtypes/cast.py no? |
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.
also cast_scalar_indexer really belongs in pandas/core/dtypes/cast.py as well (common.py is a hodge podge)
Just did a pass through the file, didnt find any.
Probably. I've got a lot of refactor-esque PRs/branches going, will move this after the current batch. |
lgtm. needs a rebase. |
rebased+green |
thanks |
using float.is_integer is apparently much faster than casting and checking equality, especially for values between int32max and int64max (anecdotal based on small sample size)
The middle three timeit results are the ones we get from this PR.