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
However, when apply a sum function to aggregate the columns inside each group, as in the example code,
df1_group.sum() results in:
f1 f2 f3
0 NaN 7 11
1 NaN 19 23
It seems it tries to do the aggregation using the columns of df instead of df1 so the columns of the resulting dataframe
include the label 'f1', which doesn't exist in df1.
The text was updated successfully, but these errors were encountered:
Here is the bug to reproduce the bug/unexpected behavior:
When running the code, we can see that df1 is:
And df1 is selected from subblocks of df:
After grouping df1 by the first level of multiindex of the columns,
we can see df1_group.groups is:
{'f2': [('f2', 's1'), ('f2', 's2')], 'f3': [('f3', 's1'), ('f3', 's2')]}
However, when apply a sum function to aggregate the columns inside each group, as in the example code,
df1_group.sum() results in:
It seems it tries to do the aggregation using the columns of df instead of df1 so the columns of the resulting dataframe
include the label 'f1', which doesn't exist in df1.
The text was updated successfully, but these errors were encountered: