Skip to content

Instantly share code, notes, and snippets.

@avances123
Last active December 23, 2016 13:06
Show Gist options
  • Save avances123/250050683ca822eb7c7793a101ee9146 to your computer and use it in GitHub Desktop.
Save avances123/250050683ca822eb7c7793a101ee9146 to your computer and use it in GitHub Desktop.
weighted random replacement
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