排除列中包含其他数据帧中的值的行

2024-09-26 18:14:02 发布

您现在位置:Python中文网/ 问答频道 /正文

我有两个数据帧,df1和df2。一个是初始数据帧(从源获得的数据),另一个较小,包含一些数学变换。为简单起见,它们都有以下布局:

df1:

A   B        C 
1   apple    a
2   pear     b
3   banana   c
4   berry    d
5   coconut  e
6   mango    f

df2:
A   B        C     D      E
1   apple    a     AT     14
2   pear     b     BT     DA
5   coconut  e     OT     OT
6   mango    f     MA     AP

本质上,我需要另一个数据帧,即df_excluded_值,它包含基于A列从df2中排除的行

谢谢


Tags: 数据apple数学布局otatdabanana

热门问题