-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
BUG: groupby.agg/transform casts UDF results #40790
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 1 commit
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
477d813
BUG: groupby.agg/transform downcasts UDF results
rhshadrach d932c93
Merge branch 'master' of https://github.com/pandas-dev/pandas into do…
rhshadrach f2069a7
Reverted behavior change when input and output are the same kind
rhshadrach 35c789f
Patch via maybe_convert_objects
rhshadrach 93fa089
Merge branch 'master' of https://github.com/pandas-dev/pandas into do…
rhshadrach 1cb216e
fixups
rhshadrach 0cafcee
whatsnew
rhshadrach 785ac9d
dtype test fixes
rhshadrach 737a366
Merge branch 'master' of https://github.com/pandas-dev/pandas into do…
rhshadrach 0b00aa7
Merge branch 'master' of https://github.com/pandas-dev/pandas into do…
rhshadrach de0f7b5
fixup
rhshadrach e95bb49
Merge branch 'dont_cast_udfs' of https://github.com/rhshadrach/pandas…
rhshadrach 4ef6794
Fixup
rhshadrach 4f97288
Add GH issue to TODOs
rhshadrach ad7d990
Added docs to user guide, agg docstring
rhshadrach 11529e3
Updated docs
rhshadrach 0ca49f6
Merge branch 'dont_cast_udfs' of https://github.com/rhshadrach/pandas…
rhshadrach a0a2640
Fixup
rhshadrach eb1943a
Fixup
rhshadrach 180bc23
docsting fixup
rhshadrach 47d97ae
Merge branch 'master' of https://github.com/pandas-dev/pandas into do…
rhshadrach 4a0978e
Add versionchanged
rhshadrach 2b38e5c
Merge branch 'master' of https://github.com/pandas-dev/pandas into do…
rhshadrach 6b80c10
Added versionchanged
rhshadrach 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
Reverted behavior change when input and output are the same kind
- Loading branch information
commit f2069a7b214ea0ac15b75ea854d09af825cac47d
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
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.
@rhshadrach can i get your help in this nearby piece of code? in all existing tests, when we get here, we have
mask.all()
. trying to come up with a case where this doesnt hold (or prove that it must always hold). any thoughts?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 like this is now removed - guessing mask.all() always held.
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.
yep.
next thing to ask your help with : IIRC you've done a lot of work in core.apply, which DataFrameGroupBy.aggregate uses. id like to make SeriesGroupBy.aggregate and DataFrameGroupBy.aggregate share more code (or at least be more obviously-similar). can i get your thoughts on how to achieve this (and whether its the effort)?
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.
Once we make aggregate always aggregate (PoC implemented in #40275), we can greatly simplify these methods. However, in order to do that we need to separate the apply/agg paths: currently apply uses agg for list/dicts and agg also uses apply for UDFs. I make a couple of attempts to do this but kept running into issues with changing behaviors without having a clear way to deprecate. This was the motivation for #41112. I plan to start working on that, assuming that's a good approach, in 1.3.