TypeError: only integer scalar arrays can be converted to a scalar index

把代码处修改如下:

#print('Optimal number of features %d' % percentiles[opt])
print('Optimal number of features %d' % np.array(percentiles)[opt])

  

猜你喜欢

转载自www.cnblogs.com/xiaodongsuibi/p/8975307.html