jeudi 24 août 2017

What does x=x[class_id] do when used on NumPy arrays

I am learning Python and solving a machine learning problem.

class_ids=np.arange(self.x.shape[0])
np.random.shuffle(class_ids)
self.x=self.x[class_ids]

This is a shuffle function in NumPy but I can't understand what self.x=self.x[class_ids] means. because I think it gives the value of the array to a variable.




Aucun commentaire:

Enregistrer un commentaire