-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
SeriesGroupBy.transform cannot handle empty series #26208
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
Comments
I suppose that would make this consistent with apply and agg: >>> g[2].apply(lambda x: x)
Series([], Name: 2, dtype: float64)
>>> g[2].agg(lambda x: x)
Series([], Name: 2, dtype: float64) If you want to take a look and have a simple way of making it work would take a PR |
Related to #17093 |
Okay, thanks. I see a possible patch. Need to read over contribution guideline and set up a working env to create a PR. |
The PR I just submitted doesn't fix #17093 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Code Sample, a copy-pastable example if possible
Problem description
Crashes on SeriesGroupby obj with zero length, which came from an empty dataframe. Would be nicer if pandas can handle this case without raising errors, by for example, just return an empty series. Thanks.
Expected Output
Output of
pd.show_versions()
The text was updated successfully, but these errors were encountered: