![](https://secure.gravatar.com/avatar/a988aad4a021ebc729915e41f33a97d3.jpg?s=120&d=mm&r=g)
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
![](https://secure.gravatar.com/avatar/209654202cde8ec709dee0a4d23c717d.jpg?s=120&d=mm&r=g)
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 <frank@horow.net> wrote:
![](https://secure.gravatar.com/avatar/209654202cde8ec709dee0a4d23c717d.jpg?s=120&d=mm&r=g)
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 <frank@horow.net> wrote:
participants (2)
-
Eric Wieser
-
Frank Horowitz