The apply
method on a groupby object appears to send all arguments to the applied function. As in, if you try to do df.groupby(level='dt').apply(func, axis=1)
, the axis=1
argument is passed to func
rather than being parsed by apply
as intended. The behavior is correct, however, in the DataFrame.apply
method.
Comment From: jreback
See docs
you are probably looking to do:
df.groupby(level='dt',axis=1).apply(func)