-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Preserve EA dtype in DataFrame.stack #23285
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
Merged
Changes from 7 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
381b073
Preserve EA dtype in DataFrame.stack
TomAugspurger 428f230
sparse
TomAugspurger 0d39be0
multi test
TomAugspurger fc37932
Merge remote-tracking branch 'upstream/master' into ea-stack
TomAugspurger 7bb5a5e
Merge remote-tracking branch 'upstream/master' into ea-stack
TomAugspurger 7e9224a
multiple columns
TomAugspurger d6661cb
remove pdb
TomAugspurger 3d41f5b
Merge remote-tracking branch 'upstream/master' into ea-stack
TomAugspurger 9f91df0
Merge remote-tracking branch 'upstream/master' into ea-stack
TomAugspurger 144d117
really object
TomAugspurger 98f75c9
remove loc
TomAugspurger 88f7f3e
Merge remote-tracking branch 'upstream/master' into ea-stack
TomAugspurger 2b858b8
Fixed merge conflict
TomAugspurger 88f08c7
Merge remote-tracking branch 'upstream/master' into ea-stack
TomAugspurger d305c86
Merge remote-tracking branch 'upstream/master' into ea-stack
TomAugspurger f6aeafa
lint
TomAugspurger 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
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.
so maybe should just move the
is_extension_array_dtype
up to first, and add ais_extension_dtype(self.values)
test as well (should encompas your is_sparse check) and is more generalThere 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'll make that change and run the test suite.
I was kinda worried about "false positives" here, but I suppose it's exactly what we want if an extension array claims it's object dtype.
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.
As posted in the unstack PR, we need to special case Space here, since it's the only (internal) extension type that has special
.astype(object)
behavior.