您可以使用to“.toList()”函数作为- list=rfe.support_u.tolist()
现在有了数组项的列表
然后使用for循环从创建的整个列表中筛选出真值,同时保持一个单独的列表作为真值的索引。
列表2=[]
对于范围(1,len(list))中的i:
if(int(list[i])==1): # for the true values list2.append(i) # the separate list with the index of true value items