On Wed, Jun 1, 2011 at 11:31 AM, Mark Miller <markperrymil...@gmail.com> wrote: > I'd love to see something like a "count_unique" function included. The > numpy.unique function is handy, but it can be a little awkward to > efficiently go back and get counts of each unique value after the > fact. >
Does bincount do what you're after? [~/] [1]: x = np.random.randint(1,6,5) [~/] [2]: x [2]: array([1, 3, 4, 5, 1]) [~/] [3]: np.bincount(x) [3]: array([0, 2, 0, 1, 1, 1]) Skipper _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion