I would like to use df.groupby() in combination with apply() to apply a function to each row per group.
df.groupby()
apply()
I normally use the following code,
For me
df2 = df.groupby('columnName').apply(lambda x: my_function(x, arg1, arg2,))
worked