Hi All, In the numpy library, are there any equivalences of numpy.put to additively store the values rather than simply overwriting? Alternatively, would there be significant speed penalties to code of the form a.flat[ind] += v Thanks in advance for any help you might be able to provide! Frank Horowitz
Frank,
I think you’re looking for np.add.at(a, ind, v), documented here
https://docs.scipy.org/doc/numpy/reference/generated/numpy.ufunc.at.html
Eric
On Fri, 19 May 2017 at 17:13 Frank Horowitz
Hi All,
In the numpy library, are there any equivalences of numpy.put to additively store the values rather than simply overwriting?
Alternatively, would there be significant speed penalties to code of the form
a.flat[ind] += v
Thanks in advance for any help you might be able to provide!
Frank Horowitz
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@python.org https://mail.python.org/mailman/listinfo/numpy-discussion
participants (2)
-
Eric Wieser
-
Frank Horowitz