Re: Faster way to map numpy arrays

2012-06-26 Thread Oscar Benjamin
On 26 June 2012 04:20, Saurabh Kabra wrote: > Thanks guys > > I implemented a numpy array with fancy indices and got rid of the list and > the loops. The time to do the mapping improved ~10x. As a matter of fact, > the number of elements in array A to be summed and mapped was different for > each

Re: Faster way to map numpy arrays

2012-06-25 Thread Saurabh Kabra
Thanks guys I implemented a numpy array with fancy indices and got rid of the list and the loops. The time to do the mapping improved ~10x. As a matter of fact, the number of elements in array A to be summed and mapped was different for each element in B (which was the reason I was using lists). B

Re: Faster way to map numpy arrays

2012-06-25 Thread Oscar Benjamin
On 25 June 2012 08:24, Stefan Behnel wrote: > Saurabh Kabra, 25.06.2012 05:37: > > I have written a script to map a 2D numpy array(A) onto another array(B) > of > > different dimension. more than one element (of array A) are summed and > > mapped to each element of array B. To achieve this I cre

Re: Faster way to map numpy arrays

2012-06-25 Thread Stefan Behnel
Saurabh Kabra, 25.06.2012 05:37: > I have written a script to map a 2D numpy array(A) onto another array(B) of > different dimension. more than one element (of array A) are summed and > mapped to each element of array B. To achieve this I create a list where I > store the index of array A to be ma

Faster way to map numpy arrays

2012-06-24 Thread Saurabh Kabra
I have written a script to map a 2D numpy array(A) onto another array(B) of different dimension. more than one element (of array A) are summed and mapped to each element of array B. To achieve this I create a list where I store the index of array A to be mapped to array B. The list is the dimensio