On Thu, Sep 30, 2010 at 12:07 AM, wrote:
> On Wed, Sep 29, 2010 at 11:24 PM, Damien Morton
> wrote:
>> On Thu, Sep 30, 2010 at 11:11 AM, wrote:
bincount only works for gathering/accumulating scalars. Even the
'weights' parameter is limited to scalars.
>>>
>>> Do you mean that bincou
On Wed, Sep 29, 2010 at 11:24 PM, Damien Morton wrote:
> On Thu, Sep 30, 2010 at 11:11 AM, wrote:
>>> bincount only works for gathering/accumulating scalars. Even the
>>> 'weights' parameter is limited to scalars.
>>
>> Do you mean that bincount only works with 1d arrays? I also think that
>> th
>>> I propose the name 'gather()' for the helper function that does this.
>>
>> I don't think "gather" is an obvious name to search for.
>
> "gather" is the name that the GPGPU community uses to describe this
> kind of operation. Not just for summation but for any kind of indexed
> reducing operati
On Thu, Sep 30, 2010 at 11:11 AM, wrote:
>> bincount only works for gathering/accumulating scalars. Even the
>> 'weights' parameter is limited to scalars.
>
> Do you mean that bincount only works with 1d arrays? I also think that
> this is a major limitation of it.
>>> from numpy import *
>>> a
On Wed, Sep 29, 2010 at 20:11, wrote:
> On Wed, Sep 29, 2010 at 9:03 PM, Damien Morton wrote:
>> On Thu, Sep 30, 2010 at 3:28 AM, Robert Kern wrote:
>>> On Wed, Sep 29, 2010 at 12:00, Pauli Virtanen wrote:
Wed, 29 Sep 2010 11:15:08 -0500, Robert Kern wrote:
[clip: inplace addition wi
On Wed, Sep 29, 2010 at 9:03 PM, Damien Morton wrote:
> On Thu, Sep 30, 2010 at 3:28 AM, Robert Kern wrote:
>> On Wed, Sep 29, 2010 at 12:00, Pauli Virtanen wrote:
>>> Wed, 29 Sep 2010 11:15:08 -0500, Robert Kern wrote:
>>> [clip: inplace addition with duplicates]
Use numpy.bincount() inste
On Thu, Sep 30, 2010 at 3:28 AM, Robert Kern wrote:
> On Wed, Sep 29, 2010 at 12:00, Pauli Virtanen wrote:
>> Wed, 29 Sep 2010 11:15:08 -0500, Robert Kern wrote:
>> [clip: inplace addition with duplicates]
>>> Use numpy.bincount() instead.
>>
>> It might be worthwhile to add a separate helper fun
On Wed, Sep 29, 2010 at 12:00, Pauli Virtanen wrote:
> Wed, 29 Sep 2010 11:15:08 -0500, Robert Kern wrote:
> [clip: inplace addition with duplicates]
>> Use numpy.bincount() instead.
>
> It might be worthwhile to add a separate helper function for this
> purpose. Bincount makes a copy that could b
Wed, 29 Sep 2010 11:15:08 -0500, Robert Kern wrote:
[clip: inplace addition with duplicates]
> Use numpy.bincount() instead.
It might be worthwhile to add a separate helper function for this
purpose. Bincount makes a copy that could be avoided, and it is difficult
to find if you don't know about
On Wed, Sep 29, 2010 at 01:01, Damien Morton wrote:
> lets say i have arrays:
>
> a = array((1,2,3,4,5))
> indices = array((1,1,1,1))
>
> and i perform operation:
>
> a[indices] += 1
>
> the result is
>
> array([1, 3, 3, 4, 5])
>
> in other words, the duplicates in indices are ignored
>
> if I wan
lets say i have arrays:
a = array((1,2,3,4,5))
indices = array((1,1,1,1))
and i perform operation:
a[indices] += 1
the result is
array([1, 3, 3, 4, 5])
in other words, the duplicates in indices are ignored
if I wanted the duplicates not to be ignored, resulting in:
array([1, 6, 3, 4, 5])
h
11 matches
Mail list logo