Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

random choice sampling numpy

>>> np.random.choice(5, 3, replace=False)
array([3,1,0])
>>> #This is equivalent to np.random.permutation(np.arange(5))[:3]
Source by docs.scipy.org #
 
PREVIOUS NEXT
Tagged: #random #choice #sampling #numpy
ADD COMMENT
Topic
Name
3+5 =