我有两个数据帧,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:
您可以使用
~
和isin()
:返回行的预期输出,其
df1
中的列“A”值在df2的列“A”中不存在:相关问题 更多 >
编程相关推荐