-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
PERF: RangeIndex.append returns a RangeIndex when possible #57467
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
This looks good, do you want to fix the conflict here @mroeschke |
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.
Looks great, added an idea for a test, but either way looks good.
ri = RangeIndex(1) | ||
result = ri.append(Index([1])) | ||
expected = RangeIndex(2) |
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.
If you think it can be useful to also add a test for the case where it can't return a RangeIndex
but an Index
maybe we can add it.
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.
Good idea; I think that would be useful. Added a test in the latest commit
…v#57467) * PERF: RangeIndex.append returns a RangeIndex when possible * add correct issue number * add correct issue number * Only if int * Guard on integer dtype kind * Add test for return Index case
Discovered in #57441