[Numpy-discussion] numpy.put as increment?

Jon Wright wright@esrf...
Wed Nov 28 02:17:31 CST 2007


Hello everyone,

I am trying to sum points onto a 3d grid using "put" with a list of 
computed array indices. I am looking for a version of "put" which 
increments, e.g. replace:

    for i in ind: a.flat[i] = v[i]

with "+=" to increment. Other operations might also be useful?

I tried using "take", then incrementing the result, but still have 
problems if the indices are not unique.

Thanks for any suggestions,

Jon


More information about the Numpy-discussion mailing list