I want to merge rows of dataframe with one common column value and then merge rest of the column values separated by comma for string values and convert to array/list for int values.
A B C D
1 one 100 value
4 four 400 value
5 five 500 value
2 two 200 value
Expecting result like:
A B C D
[1,4,5,2] one,four,five,two [100,400,500,200] value
I can use groupby for column D but how can I use apply for columns A,C as apply(np.array) and apply(','.join) for column B in df all at once?