On Sat, 4 Feb 2012 14:35:08 -0600
Benjamin Root <ben.r...@ou.edu> wrote:

> 
> no.unique() can return indices and reverse indices.  It would be trivial to
> histogram the reverse indices using np.histogram().

Even np.histogram(abc,unique_elem) or something like this. 
Works if unique_elem is ordered.

np.histogram(abc,list(unique_elem)+[unique_elem[-1]+1])[0].reshape(-1,1)
is 40x faster and gives the same result.

-- 
Jérôme Kieffer
Data analysis unit - ESRF
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to