ENH: groupby.apply axis=1 behavior #38042
Labels
API - Consistency
Internal Consistency of API/Behavior
Apply
Apply, Aggregate, Transform, Map
Enhancement
Groupby
xref #9772
now raises, but used to give the (perhaps) surprising output
A fix for this (today and previously) would be to pass
axis=1
into the call to sum, but again I think that is viewed as unintuitive. In #9772 (comment) I argued:A few counter points that I've realized in the meantime:
groupby(..., axis=1).transform
works, nor is it how apply/transform/agg with no groupby andaxis=1
work. These methods all feed in the row as a Series so that supplyingaxis=1
results in an error.I'm now of the opinion that transposing the inputs and results is more maintainable and easier to grok for users.
The text was updated successfully, but these errors were encountered: