DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
np random choice given distribution
np.random.choice(5, 3, p=[0.1, 0, 0.3, 0.6, 0]) array([3, 3, 0]) # random
Source by numpy.org #
PREVIOUS
NEXT
Tagged:
#np
#random
#choice
#distribution
ADD COMMENT
Topic
COMMENT
Name
8+8 =
Submit