On Sun, Sep 28, 2008 at 4:15 PM, Geoffrey Irving <[EMAIL PROTECTED]> wrote:
>
> Thanks. That works great. A slightly cleaner version is
>
>X += coo_matrix((Y, (K, zeros_like(K.sum(axis=1)
>
> The next question is: is there a similar way that generalizes to the
> case where X is n by 3 and
On Sat, Sep 27, 2008 at 10:01 PM, Nathan Bell <[EMAIL PROTECTED]> wrote:
> On Sun, Sep 28, 2008 at 12:34 AM, Geoffrey Irving <[EMAIL PROTECTED]> wrote:
>>
>> Is there an efficient way to implement a nonuniform gather operation
>> in numpy? Specifically, I want to do something like
>>
>> n,m = 100,
2008/9/28 Geoffrey Irving <[EMAIL PROTECTED]>:
> Is there an efficient way to implement a nonuniform gather operation
> in numpy? Specifically, I want to do something like
>
> n,m = 100,1000
> X = random.uniform(size=n)
> K = random.randint(n, size=m)
> Y = random.uniform(size=m)
>
> for k,y in z
On Sun, Sep 28, 2008 at 12:34 AM, Geoffrey Irving <[EMAIL PROTECTED]> wrote:
>
> Is there an efficient way to implement a nonuniform gather operation
> in numpy? Specifically, I want to do something like
>
> n,m = 100,1000
> X = random.uniform(size=n)
> K = random.randint(n, size=m)
> Y = random.u
Hello,
Is there an efficient way to implement a nonuniform gather operation
in numpy? Specifically, I want to do something like
n,m = 100,1000
X = random.uniform(size=n)
K = random.randint(n, size=m)
Y = random.uniform(size=m)
for k,y in zip(K,Y):
X[k] += y
but I want it to be fast. The n