[Numpy-discussion] PutSum?

jordan@math.ucs... jordan@math.ucs...
Fri Jun 11 22:06:07 CDT 2010


Hi all,

I recently needed to a simple array procedure that I assumed would be
supported (and almost is) but was surprised to find some limitations.

I've got two arrays, A and B, and some array of indices, I, and I want to
perform the operation

A[I] += B

where I and B have the same dimensions.

This works fine provided there are no repeated indices in I, but otherwise
only the last of each repeated index is used. I've written a C function I
call PutSum that does what I want, but I figured there must something
already lying around. Is there?

Cheers,
Jordan


More information about the NumPy-Discussion mailing list