input:
df1:
name, msg_time, age
adam,22-00-11, Nan
susam,23-00-14,Nan
df2:
name, age
adam, 23
i want to add msg_time
from df1
to df['age']
for specific name
output:
df2:
name, age
adam, 23,22-00-11
my code:
df2=df2.assign(age=lambda x: x.age +','+df1.msg_time)
my problem is, that i am receiving :
df2:
name, age
adam, 23,22-00-11,22-00-11,22-00-11,22-00-11
you could do it using
series.map()
and converting to string before concatenating them usingastype(str)
: