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

Modify the code as follows:

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

  

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325179289&siteId=291194637