-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG pd.NA
not treated correctly in where
and mask
operations
#53124
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
Closed
Closed
Changes from 5 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
89c0f3d
make NA propagate where and mask operations
Charlie-XIAO 321147f
changelog added
Charlie-XIAO 36bbe16
fix when using boolean arrays
Charlie-XIAO e2216cb
added tests, reword NA propagates -> if cond=NA then element propagates
Charlie-XIAO 5a45a29
Merge branch 'main' into na-masked-unexp
Charlie-XIAO 9875669
avoid multiple fillna when unnecessary
Charlie-XIAO 8381aba
Merge branch 'main' into na-masked-unexp
Charlie-XIAO 5a41560
Merge branch 'main' into na-masked-unexp
Charlie-XIAO 8af09df
Merge branch 'main' into na-masked-unexp
Charlie-XIAO 3859bff
Merge branch 'main' into na-masked-unexp
Charlie-XIAO c1d43c8
Merge remote-tracking branch 'upstream/main' into na-masked-unexp
Charlie-XIAO c542727
Merge branch 'na-masked-unexp' of https://github.com/Charlie-XIAO/pan…
Charlie-XIAO 8140c5b
Merge branch 'main' into na-masked-unexp
Charlie-XIAO a2151be
Merge branch 'main' into na-masked-unexp
Charlie-XIAO 6f90c1c
Merge remote-tracking branch 'upstream/main' into na-masked-unexp
Charlie-XIAO 394d4bb
Merge branch 'na-masked-unexp' of https://github.com/Charlie-XIAO/pan…
Charlie-XIAO 1cc6208
Merge remote-tracking branch 'upstream/main' into na-masked-unexp
Charlie-XIAO 09f62bc
raise in where and mask if cond is nullable bool with NAs
Charlie-XIAO b55f411
Merge remote-tracking branch 'upstream/main' into na-masked-unexp
Charlie-XIAO cbbd866
remove conflicting (?) test and improve message
Charlie-XIAO 3a34a85
Merge remote-tracking branch 'upstream/main' into na-masked-unexp
Charlie-XIAO 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
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
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.
has the option of just raising on NAs been discussed? seems ambiguous and a general PITA.
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 are saying raising in
where
andmask
, no we haven't discussed yet. If you are saying raising in_where
, I think this is not desired since then, the following will not work: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.
i would just have that raise too, yes.
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.
@jbrockmendel I think the above code snippet actually works for versions
v2.0.x
, do we really want to change its behavior? @topper-123 I think we may need further discussion about the desired behavior of_where
, i.e., propagate or raise. I will postpone the rewording mentioned in #53124 (comment) until maintainers reach an agreement.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.
IMO we should accept BooleanArrays (and Series/DataFrame containing BooleanArrays/ArrowArray[bool]) as conditional here. I think it will be surprising if those data structure work in
loc
and not here.Do similar functionality raise in any other methods? I don't recall any.
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.
Hi @jbrockmendel any updates on this?