我有两个数据帧,我们称它们为df1和df2。
df1:
ID label1 label2
1 green warm
2 blue cold
3 red chilly
4 blue warm
df2:
ID label3 label4
1 good funny
2 bad calm
3 ok energizing
4 bad relaxing
5 ok scary
6 good funny
7 bad scary
并且我只想将两个数据框以它们具有的共同ID连接起来,并得到如下输出:
ID label1 label2 label3 label4
1 green warm good funny
2 blue cold bad calm
3 red chilly ok energizing
4 blue warm bad relaxing
有什么想法吗?