Since they are just strings
mean, which are valid Pandas function names, you can pass them as is with
apply. Also, you can rewrite your code so it can be a bit more readable:
# Please please do not use `dict` as a variable for k, (col,op) in your_dict.items(): df.groupby(k)[col].agg(op)
CLICK HERE to find out more related problems solutions.