[英]Concat or Merge Two Data Frames with same values
Here is the first table(DataFrame) which has the 'sender' column with the value of 79这是第一个表(DataFrame),其“发件人”列的值为 79
And Here is the Second table(DataFrame) which has the 'id' column as first column and written with departments,age of employee etc.这是第二个表(DataFrame),它的第一列是“id”列,并写有部门、员工年龄等。
And here is my desired output for these two dataframes这是我想要的这两个数据帧的 output
My goal is merge or concat two dataframes, sender is a employee id of which sends the message and on employee table it is involved the personal information of employees.我的目标是合并或连接两个数据帧,发件人是发送消息的员工 ID,在员工表上涉及员工的个人信息。 At the and I want to call and concatenate message senders with his/her personal info like in the third image.
在和我想打电话给消息发件人并将其与他/她的个人信息连接起来,如第三张图片所示。 Thank you so much from now.
从现在开始非常感谢你。
Try to write your dfs instead of uploading images.尝试编写您的 dfs 而不是上传图像。 Anyhow, considering
df1
your first df and df2
the second:无论如何,考虑
df1
你的第一个 df 和df2
第二个:
df1 = df1.merge(df2, left_on='sender',right_on='id', how='left')
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.