I have a dataframe df, with two columns, I want to groupby one column and join the lists belongs to same group, example:
column_a, column_b
1,         [1,2,3]
1,         [2,5]
2,         [5,6]
after the process:
column_a, column_b
1,         [1,2,3,2,5]
2,         [5,6]
I want to keep all the duplicates. I have the following questions:
- The dtypes of the dataframe are object(s). convert_objects() doesn't convert column_b to list automatically. How can I do this?
- what does the function in df.groupby(...).apply(lambda x: ...) apply to ? what is the form of x ? list?
- the solution to my main problem?
Thanks in advance.
 
     
     
     
    
 
     
     
    