-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
groupby fails when MultiIndex contains Int64Index in an empty DataFrame in 1.0.0 #31670
Comments
Can you post a traceback? I don't see an exception on master or 1.0.0. |
|
I also couldn't reproduce in my default environment, and the main difference seemed to be the python version. And indeed, creating an env with python=3.6 and pandas=1.0, I get this as well:
|
Sorry, didn't test it correctly in my 1.0.0 env, I just get it there as well, regardless of the python version. |
Code Sample, a copy-pastable example if possible
Problem description
When groupby is over a
Int64Index
in aMultiIndex
for an empty DataFrame, the groupby fails with error:ValueError: Unable to fill values because Int64Index cannot contain NA
Expected Output
The groupby should not raise an error, instead the code above should output an empty DataFrame as would happen for
df[df.value < 0].groupby("category").sum()
Output of
pd.show_versions()
The text was updated successfully, but these errors were encountered: