Re: [Numpy-discussion] nicest way to apply an arbitrary sequence of row deltas to an array

2009-12-21 Thread George Dahl
So with bincount I can exchange a loop over P for a loop over M? I guess for me that is still really helpful. Thanks! - George On Mon, Dec 21, 2009 at 6:35 AM, Pauli Virtanen wrote: > Mon, 21 Dec 2009 09:35:08 +, Neil wrote: > [clip] >> I'm also interested to see if there are any answers to

Re: [Numpy-discussion] nicest way to apply an arbitrary sequence of row deltas to an array

2009-12-21 Thread josef . pktd
On Mon, Dec 21, 2009 at 6:35 AM, Pauli Virtanen wrote: > Mon, 21 Dec 2009 09:35:08 +, Neil wrote: > [clip] >> I'm also interested to see if there are any answers to this; I came >> across a similar problem recently. It would have been convenient to do >> something like U[idx] += dU, but this d

Re: [Numpy-discussion] nicest way to apply an arbitrary sequence of row deltas to an array

2009-12-21 Thread Pauli Virtanen
Mon, 21 Dec 2009 09:35:08 +, Neil wrote: [clip] > I'm also interested to see if there are any answers to this; I came > across a similar problem recently. It would have been convenient to do > something like U[idx] += dU, but this didn't work because there were > repeated indices in idx. Here's

[Numpy-discussion] nicest way to apply an arbitrary sequence of row deltas to an array

2009-12-20 Thread George Dahl
Hi everyone, I was wondering if anyone had insight on the best way to solve the following problem. Suppose I have a numpy array called U. U has shape (N,M) Suppose further that I have another array called dU and that dU has shape (P,M) and that P has no particular relationship to N, it could be la