import numba
@numba.njit
def sum_func(index, values):
return pd.Series(np.sum(values), index=index)
df_long_control[['user_id', 'reward_type', 'reward']].groupby(['user_id', 'reward_type'], as_index=False).apply(sum_func, engine='numba')
I’m trying to group by user_id
and reward_type
and apply sum function using numba, but got an error
TypeError: sum_func() got an unexpected keyword argument 'engine'