mercredi 14 octobre 2020

problem in using np.random.choice from python

indices=np.random.choice(5, 3) 
x[indices] 

While I am running this I am getting this error:

IndexError                                
Traceback (most recent call last) <ipython-input-19-75fcdd91faa9> in <module>()       
1 indices=np.random.choice(5, 3) ----> 2 x[indices]  
IndexError: index 4 is out of bounds for axis 0 with size 3



Aucun commentaire:

Enregistrer un commentaire