Basically, what you want to do is a histogram. Numpy has that
functionality built in. However: the version built in to numpy is about
as suboptimal as yours. The problem is the unnecessary sorting of the data.
In principle, a histogram does not need any sorting, so it could be done
in strictly
Hello,
As a converting MATLAB user I am bringing over some of my code. A core
function I need is to sample the probability distribution of a given set of
data. Sometimes these sets are large so I would like to make it as efficient
as possible. (the data are integers representing members of a