def my_per_group_func(temp):
# apply some tricks here
return a, b, c, d
output = dataframe.groupby('group_id').apply(my_per_group_func)
my question here is how to aggregate "output" back to a dataframe with some column names (obviously the index of the dataframe is group_id)?
normally what i do is to use the aggregate function
but the problem here is that the my_per_group_func is very complicated here, it cannot be done using the normally 'aggregate' function syntax
does anyone have a clue?
Thanks