2009/4/30 David Warde-Farley :
> Have you considered coding up a looped version in Cython? If this is
> going to be a bottleneck then it would be very worthwhile. Stéfan's
> code is clever, although as he points out, it will create an
> intermediate array of size (len(I))**2, which may end up being
David Warde-Farley wrote:
> On 29-Apr-09, at 5:49 PM, Dan Goodman wrote:
>
>> Thanks David, that's nice but unfortunately that Python loop will kill
>> me. I'm thinking about some simulation code I'm writing where this
>> operation will be carried out many, many times, with large arrays I. I
>> fi
Stéfan van der Walt wrote:
> 2009/4/29 Dan Goodman :
>> Here's the problem I want to write vectorised code for. I start with an
>> array of indices, say I=array([0,1,0,2,0,1,4]), and I want to come up
>> with an array C that counts how many times each index has been seen so
>> far if you were count
On 29-Apr-09, at 5:49 PM, Dan Goodman wrote:
> Thanks David, that's nice but unfortunately that Python loop will kill
> me. I'm thinking about some simulation code I'm writing where this
> operation will be carried out many, many times, with large arrays I. I
> figure I need to keep the Python ove
David Warde-Farley wrote:
> On 29-Apr-09, at 5:06 PM, Dan Goodman wrote:
>
>> Here's the problem I want to write vectorised code for. I start with
>> an
>> array of indices, say I=array([0,1,0,2,0,1,4]), and I want to come up
>> with an array C that counts how many times each index has been seen
2009/4/29 Dan Goodman :
> Here's the problem I want to write vectorised code for. I start with an
> array of indices, say I=array([0,1,0,2,0,1,4]), and I want to come up
> with an array C that counts how many times each index has been seen so
> far if you were counting through the array from the be
On 29-Apr-09, at 5:06 PM, Dan Goodman wrote:
> Here's the problem I want to write vectorised code for. I start with
> an
> array of indices, say I=array([0,1,0,2,0,1,4]), and I want to come up
> with an array C that counts how many times each index has been seen so
> far if you were counting th
Hi all,
Here's the problem I want to write vectorised code for. I start with an
array of indices, say I=array([0,1,0,2,0,1,4]), and I want to come up
with an array C that counts how many times each index has been seen so
far if you were counting through the array from the beginning to the
end,