PD合并特定列
您能帮我吗,如何在空白excel列中的特定列上进行vlookup或PD合并。我只知道如何进行PD合并,并且该值作为新列出现,
我有一个dataframe df1
index id Value Info
0 0 A1 xxx
1 1 A2 xxx
2 2 A3 xxx
3 3 A4 xxx
,此外,此数据帧df2
index id Value
0 0 A1 Apple
1 1 A2 Orange
2 2 A3 Banana
3 3 A4 Grape
我希望在合并df1
和df2
index id Value Info
0 0 A1 Apple xxx
1 1 A2 Orange xxx
2 2 A3 Banana xxx
3 3 A4 Grape xxx
can u help me, how to do vlookup or pd merge on speccific column in the blank excel column. I just know how to do pd merge and the value come as a new column
I have a dataframe df1
index id Value Info
0 0 A1 xxx
1 1 A2 xxx
2 2 A3 xxx
3 3 A4 xxx
and also this data frame df2
index id Value
0 0 A1 Apple
1 1 A2 Orange
2 2 A3 Banana
3 3 A4 Grape
I wish to get to the following outcome when merging df1
and df2
index id Value Info
0 0 A1 Apple xxx
1 1 A2 Orange xxx
2 2 A3 Banana xxx
3 3 A4 Grape xxx
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
考虑到熊猫的操作,这可能是直接的。
您可以使用:
以下输出:
This could be straight forward considering pandas operations.
You could use:
which gives the below output: