s1=[[123,456,789...],[234,567,89],.....]
s2=[[123,...],[567,89],.....]
df=[s1,s2]
s2[i]
是s1[i]
的子列表,表示set(s2[i])<set(s1[i])
我想添加s3
set(s3[i])=set(s1[i])-set(s2[i])
答案 0 :(得分:0)
s3=[]
for i in range(len(s1)):
s3.append(list(set(s1[i])-set(s2[i])))
或
s3=[list(set(s1[i])-set(s2[i]))for i in range(len(s1))]