[Numpy-discussion] accumulating version of numpy.put?

Eric Wieser wieser.eric+numpy at gmail.com
Fri May 19 12:24:01 EDT 2017


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 at horow.net> wrote:

> 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 at python.org
> https://mail.python.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20170519/e1a39c37/attachment.html>


More information about the NumPy-Discussion mailing list