[Numpy-discussion] numpy.put as increment?

Jon Wright wright at esrf.fr
Wed Nov 28 03:17:31 EST 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