-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
PERF: Series(dict) returns RangeIndex when possible #58118
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
np_sequence = np.asarray(sequence, dtype=np.int64) | ||
try: | ||
np_sequence = np.asarray(sequence, dtype=np.int64) | ||
except OverflowError: |
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.
Why is the OverflowError required in this case? Have we added that elsewhere to support the RangeIndex return?
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.
This line will fail if the sequence contains an int over the max int64
value e.g. test_loc_uint64
.
This is the only pathway that can convert an arbitrary sequence to a RangeIndex return
Thanks @mroeschke |
Discovered in #57441