
Feb. 27, 2014
9:11 p.m.
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? Thanks, Alan Isaac

February 2014
10:01 p.m.
On Thu, Feb 27, 2014 at 6:11 PM, Alan G Isaac <alan.isaac@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.
4031
Age (days ago)
4031
Last active (days ago)
1 comments
2 participants
participants (2)
-
Alan G Isaac
-
Jaime Fernández del Río