-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
groupby w/ only NULL-groups crashes since 0.23 #21624
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
Thanks for the report - investigation and PRs are always welcome! |
Fixes bug where operations such as transform('sum') raise errors when only a single null group exists.
I came upon this issue when I got a SIGSEGV after a groupby where one collumn contained some NaN values. Removing them avoided the crash. However, I cannot see a difference in behaviour between 0.22.0 and master, both raise the ValueError for me. @crepererum Are you sure your example does not raise that error with 0.22.0? |
@tobycheese yes. |
Indeed. With Python 2.7.10 and Pandas 0.22.0 there is no error, with Python 3.6.5 and Pandas 0.22.0 there is the ValueError. |
This work on master. Could use a test.
|
Code Sample, a copy-pastable example if possible
Problem description
groupby
ignores groups that contain NULL-elements in any of the group columns. In that case, results oftransform
are NULL (NaN for floats, NaT for time, None for objects). The question is what happens if there are only "NULL groups":None
objects is createdValueError: Length of passed values is 1, index implies 0
)Expected Output
A NULL-column according to the input data type.
Output of
pd.show_versions()
The text was updated successfully, but these errors were encountered: