Closed
Description
I was interested in choosing k elements out of n without replacement or weighted probabilities, and with k<<n.
I've tested using the following ipython notebook: source / view.
The outcome was that using random.sample(xrange(n),k)
was ~50-fold faster than using np.random.permutation(n)[:k]
, which is the way it is currently coded.