需要与其他2个带有布尔条件的列一起检查总列 期待
df['output']
下面是预期结果的数据框,共有4列
uid,first,second,total,first_res,second_res,total_res
uid,first,second,total,first_res,second_res,total_res,output
1001,a,b,c,{'a':True},{'b':False},{'c':True}, {'key': 'a+c'}
1002,a,b,c,{'a':False},{'b':True},{'c':True}, {'key': 'b+c'}
1003,a,b,c,{'a':False},{'b':False},{'c':True}, null
1004,a,b,c,{'a':True},{'b':True},{'c':False}, null
需要通过检查True
条件与第一列和第二列的总列进行比较
有4种情况:
如果total
c
键是False
,请不要检查,将其打印为null或其他内容
如果total
c
键是True
,第一个a key
,第二个b key
是False
,则不要检查,打印为null或其他内容
如果total
c
键是True
并且第一个a key
是True,第二个b key
是False
然后是{'key ':'a + c'}
如果total
c
键是True
并且第一个a key
是False,第二个b key
是True
然后是{'key ':'b + c'}
不可能全部都是True:)
例如,如果a是您正在发送的请求,而{'a':True}是您收到的响应,也类似于b。 total
是您已经收到的回复。需要与条件为真相比较。