control1 = [933, 1101, 471, 577, 507, 1124, 1354, 1754, 18591, 11327, 10140, 1021769]
ct1 = [33, 101, 472,5077, 9507, 1124, 13584, 1574, 18591, 10327, 10140, 10276, 10635, 13366, 10480, 103961, 103979, 1047]
def control_treatment(dataset):
vals = dataset[dataset["account_id"].isin(ct1)]
vals= vals.withColumn("account_id", vals["account_id"].cast(IntegerType()))
if vals[vals['account_id'].isin(control)]:
return 1
else:
return 0
return control_treatment
我需要一个返回1和0的伪值的列。因此,当ct1的帐户ID位于/matches control1中时,创建的新列应该为1,否则为0
1条答案
按热度按时间wgmfuz8q1#