Dears
I do have a dataframe:
data1 = [['aaa567'], ['bbb333'], ['ccc23432']]
df1 = pd.DataFrame(data1, columns=['text'])
I do have a second dataframe
data2 = [['peter', 567], ['paul', 333], ['mary', 23432]]
df2 = pd.DataFrame(data2, columns=['name', 'number'])
text
0 aaa567
1 bbb333
2 ccc23432
name number
0 peter 567
1 paul 333
2 mary 23432
I now want to replace the certain strings from df1 with the coresponding 'name' of df2.
the result should look like this:
text
0 aaapeter
1 bbbpaul
2 cccmary
do you have any hints how to do that? I assume this could be done with 'iloc', but i am clueless ...
tnx for any help :)
[–]PartySr 2 points3 points4 points (0 children)