-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
PERF: Avoid np.divmod in maybe_sequence_to_range #57812
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
mroeschke
merged 16 commits into
pandas-dev:main
from
mroeschke:ref/is_range_indexer/step
Mar 21, 2024
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
9b18b6b
PERF: Avoid np.divmod in RangeIndex._shallow_copy
mroeschke 9bcc4ea
Make is_range
mroeschke c9339d5
pyi error
mroeschke 1e98a41
Merge remote-tracking branch 'upstream/main' into ref/is_range_indexe…
mroeschke 0b484bd
Use step
mroeschke 981e3c9
Merge remote-tracking branch 'upstream/main' into ref/is_range_indexe…
mroeschke 997416f
Switch back to int6432
mroeschke d3ae4e9
Merge remote-tracking branch 'upstream/main' into ref/is_range_indexe…
mroeschke b8ea98c
try int64_t
mroeschke 21f13d9
Revert "try int64_t"
mroeschke 2c77071
Merge remote-tracking branch 'upstream/main' into ref/is_range_indexe…
mroeschke 3daca65
Merge remote-tracking branch 'upstream/main' into ref/is_range_indexe…
mroeschke 339a914
Merge remote-tracking branch 'upstream/main' into ref/is_range_indexe…
mroeschke 503d96f
Adjust maybe_sequence_to_range
mroeschke 58a6f27
Merge remote-tracking branch 'upstream/main' into ref/is_range_indexe…
mroeschke 5f31dd8
Access first element once
mroeschke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Don’t we only need int64?
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.
Sometimes we'll be calling
self._shallow_copy(Index[int]._values)
so I suppose theint
type could be non-int64There 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.
Maybe should just use
np.intp
? That matches what range would use internallyThere 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.
Looks like
np.intp
didn't work for the 32 bit and Windows build 0b484bdThere 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.
Are you seeing build failures just doing what @jbrockmendel suggests with int64 then? The error message
ValueError: Buffer dtype mismatch, expected 'intp_t' but got 'long long'
on the 32 bit build would seemingly indicate the 32 bit part of the fused type is unused, sincelong long
is by definition at least 64 bitshttps://github.com/pandas-dev/pandas/actions/runs/8268872377/job/22622796389#step:4:43677
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.
With just
int64_t
, 32 bit and Windows builds are failing withValueError: Buffer dtype mismatch, expected 'int64_t' but got 'long'
https://github.com/pandas-dev/pandas/actions/runs/8284194543/job/22669177062?pr=57812