我有三个数据集:
Fact =1的所有行(不管标签为0)构建的;df1
User Label Fact Date
321 1 0 28-04
312 1 0 22-02
315 1 0 21-12
...df2
User Label Fact Date
21 0 1 18-04
532 0 1 02-01
135 0 1 22-12
...df
User Label Fact Date
321 1 0 28-04
312 1 0 22-02
315 1 0 21-12
...
21 0 1 18-04
532 0 1 02-01
135 0 1 22-12
...
241 0 0 21-12
54 0 0 23-11
...我想知道如何使用联接“提取”具有Label=0 and Fact = 0的数据集。由于我对条件Label=0 and Fact = 0感兴趣,所以我可以只使用一个逻辑条件来提取行,但我对可能的备选方案很好奇。
谢谢
发布于 2020-09-30 23:02:20
df[(df["Label"]==0) & (df["Fact"]==0)]应该给你想要的东西,或者也可以给你df2[df2["Label"]==0]。但你所说的可能的替代方案是什么意思?
https://stackoverflow.com/questions/64146759
复制相似问题