my code:
basket = response.groupby('user_id')[['call', 'signal','others']].apply(list)
basket
what I get:
user_id
1 [call, signal,others]
2 [call, signal,others]
3 [call, signal,others]
4 [call, signal,others]
but I want to create a column with name 'final' and all values in the call, signal,others will look like a list.
see what I want
user_id final
1 [A, B,C]
2 [A, B]
3 [B]
4 [B]
NO DUPLICATE ON EACH USER ROW i.e [A,A,B,B, C]
As you didn't provide the input data, it was hard to resolve the output. Some how I manage to come up with the solution