-
Notifications
You must be signed in to change notification settings - Fork 913
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
Defer to iloc
when indexer is an integer-like object and the Index
is non-numeric dtype
#7897
Conversation
Codecov Report
@@ Coverage Diff @@
## branch-0.20 #7897 +/- ##
===============================================
+ Coverage 82.88% 82.91% +0.02%
===============================================
Files 103 103
Lines 17668 17660 -8
===============================================
- Hits 14645 14643 -2
+ Misses 3023 3017 -6
Continue to review full report at Codecov.
|
@isVoid very good point, maybe post this in Slack to make it more visible to everyone? Especially with regard to the PR description, often people write initial descriptions with questions for the reviewers or requests for help, so it would be good to have the final description updated before PRs get merged. |
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.
lgtm!
iloc
when indexer is an integer-like object and the Index
is non-integer dtypeiloc
when indexer is an integer-like object and the Index
is non-numeric dtype
rerun tests |
@gpucibot merge |
Pandas interprets
idx
in the expressionsr[idx]
as an absolute position in the seriessr
whenidx
'sdtype
is different from that ofsr
'sIndex
.In Pandas, the indexing takes both an integer and a string as the index:
Whereas cuDF treats
idx
as a value to look up insr
's Index, which can lead to different behaviors when indices have non-integral dtypes:This PR fixes the mismatch behavior in cuDF by deferring to
iloc
when a Series has a non-numerical Index and the indexeridx
is an integer-like value: int, cudf Scalar, numpy int [np.int8, np.uint32, int64
,,,]Fixes: #7622
Replaces: #7775