
27 Feb
2014
27 Feb
'14
7: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

27 Feb
27 Feb
8: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.
3381
Age (days ago)
3381
Last active (days ago)
1 comments
2 participants
participants (2)
-
Alan G Isaac
-
Jaime Fernández del Río