-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Fixes groupby.apply() error when no returns #9684 #9685
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
Sorry, don't quite follow. Would you mind elaborating? |
@@ -2808,7 +2808,12 @@ def _wrap_applied_output(self, keys, values, not_indexed_same=False): | |||
|
|||
# make Nones an empty object | |||
if com._count_not_none(*values) != len(values): | |||
v = next(v for v in values if v is not None) | |||
try: |
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.
v = [ v for v in values if v is not None ]
if not v:
return DataFrame()
OK -- I'd then need to extract the first item from the list below that. That still preferable? |
@nickeubank hmm, maybe leave it the original (and put in a try except for StopIteration like you did). |
whats new is now available for 0.16.1 5ebf521 |
pls add a test and a mention in v0.16.1 whatsnew. |
@@ -55,7 +55,7 @@ Bug Fixes | |||
|
|||
|
|||
- Bug in ``transform`` causing length mismatch when null entries were present and a fast aggregator was being used (:issue:`9697`) | |||
|
|||
- Fixed bug in groupby.apply() that would cause error if no values returned. (:issue:`9685`) |
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.
use backticks around groupby.apply
and reprase as bit: "would raise if the return value of the user passed function was None
"
merged via 990972b thanks! |
Closes issue: #9684
Returns empty object even if all entries are missing.