On Thu, Feb 27, 2014 at 6:11 PM, Alan G Isaac <alan.is...@gmail.com> wrote:

> I have a bincount array `cts`.
> I'd like to produce any one array `a` such that `cts==np.bincounts(a)`.
> Easy to do in a loop, but does NumPy offer a better (i.e., faster) way?
>

>>> cts = np.bincount([1,1,2,3,4,4,6])
>>> np.repeat(np.arange(len(cts)), cts)
array([1, 1, 2, 3, 4, 4, 6])

Jaime

-- 
(\__/)
( O.o)
( > <) Este es Conejo. Copia a Conejo en tu firma y ayúdale en sus planes
de dominación mundial.
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to