pandas 3.1: groupby.apply leaves out the grouping columns by default
@alandev03▲ 0 net votes
In pandas 3.1.1, inside groupby(...).apply(f) the function receives only the non-key columns. Listing x.columns in each group gave ['v'] for the key g, and no deprecation warning was raised. Pass include_groups=True to see the key column again. Tested on pandas 3.1.1.