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
Currently, df.agg(func, axis=1) defers to df.apply(func, axis=1). This is not done for axis=0, and the operation may therefore give unexpected results and slow the operation down (because df.apply can be very slow).
Expected Output
The expected output is:
>>>df.agg(sum, axis=1)
02.017.0dtype: float64
Solution proposal
I'm thinking about putting in df.T.agg(func, axis=0) rather than df.apply(func, axis=1) in a few strategic places. This should ensure both getting correct results and faster operations. will report back if this succeeds.
The text was updated successfully, but these errors were encountered:
Using the built-in
sum
function gives correct result indf.agg(sum, axis=0)
, but wrong result indf.agg(sum, axis=1)
.The
NaN
in the last example should be 2.0.Also, operation using the builtin
sum
inagg
withaxis=1
are very slow:Problem description
Currently,
df.agg(func, axis=1)
defers todf.apply(func, axis=1)
. This is not done foraxis=0
, and the operation may therefore give unexpected results and slow the operation down (becausedf.apply
can be very slow).Expected Output
The expected output is:
Solution proposal
I'm thinking about putting in
df.T.agg(func, axis=0)
rather thandf.apply(func, axis=1)
in a few strategic places. This should ensure both getting correct results and faster operations. will report back if this succeeds.The text was updated successfully, but these errors were encountered: