python判断两列表的相同元素,并返回索引

keep_bool = np.sum([a==i for i in b], axis=0)
keep_indices = np.where(keep_bool)[0]
print(keep_bool)
return keep_indices

你可能感兴趣的:(python判断两列表的相同元素,并返回索引)