Re: [Numpy-discussion] Need faster equivalent to digitize

2010-04-14 Thread Peter Shinners
al Python > Subject: [Numpy-discussion] Need faster equivalent to digitize > > I am using digitize to create a list of indices. This is giving me > exactly what I want, but it's terribly slow. Digitize is obviously not > the tool I want for this case, but what numpy alternative do I h

Re: [Numpy-discussion] Need faster equivalent to digitize

2010-04-14 Thread Nadav Horesh
import numpy as N N.repeat(N.arange(len(a)), a) Nadav -Original Message- From: numpy-discussion-boun...@scipy.org on behalf of Peter Shinners Sent: Thu 15-Apr-10 08:30 To: Discussion of Numerical Python Subject: [Numpy-discussion] Need faster equivalent to digitize I am using

[Numpy-discussion] Need faster equivalent to digitize

2010-04-14 Thread Peter Shinners
I am using digitize to create a list of indices. This is giving me exactly what I want, but it's terribly slow. Digitize is obviously not the tool I want for this case, but what numpy alternative do I have? I have an array like np.array((4, 3, 3)). I need to create an index array with each inde