I have a pandas data frame in which one of the columns is a Series itself. Eg:
df.head()
Col1 Col2
1 ["name1","name2","name3"]
1 ["name3","name2","name4"]
2 ["name1","name2","name3"]
2 ["name1","name5","name6"]
I need to concatenate the Col2 in groups of Col1. I want something like
Col1 Col2
1 ["name1","name2","name3","name4"]
2 ["name1","name2","name3","name5","name6"]
I tries using a groupby as
.agg({"Col2":lambda x: pd.Series.append(x)})
But this throws error saying two parameters are required. I also tried using sum in the agg function. That fails with error does not reduce.
How do I do this?