I have a df:
a b c
0 'd' 1 ['f', 'h']
1 'f' 2 ['u', 'v']
2 'g' 3 ['i', 'o']
I want to append df['a'] to each element of df['c'] column. expected output:
a b c d
0 'd' 1 ['f', 'h'] ['fd', 'hd']
1 'f' 2 ['u', 'v'] ['uf', 'vf']
2 'g' 3 ['i', 'o'] ['ig', 'og']
I tried for loops, and an attempt at list comprehension, but it was garbage. To avoid for loops, I have tried this vectorized approach. But did not work.
df['d']=df['c'].cat(df['a'],axis=0).values.tolist()
As always, any help, much appreciated.
['f', 'h']