python判断两列表的相同元素,并返回索引
2019-06-06 本文已影响0人
Williamongh
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
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