[Numpy-discussion] Incrementing with advanced indexing: why don't repeated indexes repeatedly increment?
jsalvati at u.washington.edu
Wed Jun 6 12:48:57 EDT 2012
That does seem like it should work well if len(unique(idx)) is close to
On Wed, Jun 6, 2012 at 9:35 AM, Robert Kern <robert.kern at gmail.com> wrote:
> On Wed, Jun 6, 2012 at 4:52 PM, Robert Cimrman <cimrman3 at ntc.zcu.cz>
> > Yes (in that thread), but it applies also adding/assembling vectors into
> > global vector - this is just x[idx] += vals. I linked that discussion as
> > was recent enough for me to recall it, but there were other.
> > Anyway, my point was that a having a function with the "adding"
> semantics in
> > NumPy would be handy.
> x += numpy.bincount(idx, vals, minlength=len(x))
> Robert Kern
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion