Publisher review:Weighted choice script return random samples of cumulative vector (1-D numpy array) c. This script uses fact that any probability distributions can be sampled by computing the cumulative distribution, drawing a random number from 0 to 1, and finding the x-value where that number is attained on the cumulative distribution. The searchsorted(..) function performs this search.
This script return random samples of cumulative vector (1-D numpy array) c. Each element of array returned is an integer from 0 through n-1, where n is the length of c.
Weighted choice 1.0 is a Python script for Programming Methods and Algorithms scripts design by James Coughlan.
It runs on following operating system: Windows / Linux / Mac OS / BSD / Solaris.
return random samples of cumulative vector (1-D numpy array) c.
Operating system:Windows / Linux / Mac OS / BSD / Solaris