现有数据框架:
Id condition1 condition2 score
A attempt pass 0
A attempt fail 0
B attempt pass 0
B attempt level_1 0
B attempt fail 0
C attempt fail 0
D attempt fail 0
预期的 Dataframe :
Id condition1 condition2 score
A attempt pass 1
A attempt fail 1
B attempt pass 1
B attempt level_1 1
B attempt fail 1
C attempt fail 0
D attempt fail 0
如果满足以下任何一行的条件,我希望将唯一ID的每行中的分数标记为1:条件1 ==“尝试”&条件2 ==“通过”。
1条答案
按热度按时间zaqlnxep1#
您可以尝试: