You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this was fixed by #9177, which is in 0.16.0 (released today).
In [3]: df.groupby(level=[0,1]).mean()
Out[3]:
x
A B
one a 6
three a 1
b 2
c 3
two a 4
b 5
In [4]: df.x.groupby(level=[0,1]).mean()
Out[4]:
A B
one a 6
three a 1
b 2
c 3
two a 4
b 5
Name: x, dtype: int64
This behavior seems strange to me. Starting with a multiindex dataframe with unbalanced levels:
Groupby aggregations on this dataframe seem to revert the index to the cross product of the levels, potentially leaving many NAs in the result:
But with the series this doesn't occur (no NAs in the result):
I'm wondering if this is a bug or intended behavior? I haven't been able to find any mention of different behavior in the docs.
The text was updated successfully, but these errors were encountered: