Last active
December 23, 2016 13:06
-
-
Save avances123/250050683ca822eb7c7793a101ee9146 to your computer and use it in GitHub Desktop.
weighted random replacement
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from numpy.random import choice | |
choice([1, 2, 3, 4], 2, replace=False, p=[0.33, 0.33, 0.17, 0.17]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/numpy/numpy/blob/master/numpy/random/mtrand/mtrand.pyx#L1149