samedi 21 mai 2016

numpy: random select K items from total M(M>K) items?

Is there some handy implementation of Matlab function randperm in numpy that random select K items from totally M(M>K) items, and return the selected indice?

In Matlab,

randperm(100,10)

ans =

82    90    13    89    61    10    27    51    97    88




Aucun commentaire:

Enregistrer un commentaire