Python 如果第一个df列中的项目与第二个df列中的项目匹配,如何将列中的项目与第二个数据帧中的项目分离?

Python 如果第一个df列中的项目与第二个df列中的项目匹配,如何将列中的项目与第二个数据帧中的项目分离?,python,pandas,dataframe,google-colaboratory,series,Python,Pandas,Dataframe,Google Colaboratory,Series,我已根据条件将单个df分离为两个不同的df: 条件1 key_df = output[(output['pass.shot_assist'].notna()) & (output['player.name'] == 'Kieran Trippier')].reset_index(drop= True) key_df.head(5) 对于上述代码,我得到的df是: 条件2 match = eng_wc.loc[(eng_wc['type.name'] == 'Shot') &

我已根据条件将单个df分离为两个不同的df:

条件1

key_df = output[(output['pass.shot_assist'].notna()) & (output['player.name'] == 'Kieran Trippier')].reset_index(drop= True)
key_df.head(5)
对于上述代码,我得到的df是:

条件2

 match = eng_wc.loc[(eng_wc['type.name'] == 'Shot') & (eng_wc['possession_team.name'] == 'England')]
这方面的df是

第二个DF中,在快照列中。key_pass_id有某些id(如第1列所示),其中一些id指的是第一个DF中的id。如果传球DF的id与射门列中的id匹配,我需要从射门DF中找到这些射门的位置

有人能帮我吗?图像中未显示位置shot.key\u pass\u id列,但如果您需要,我可以提供这些列

另外,我不知道如何把dfs作为表格,因此图片。这本书读起来很乏味,很抱歉