Re: [Numpy-discussion] Proposal for new ufunc functionality

2010-04-14 Thread Stephen Simmons
I would really like to see this become a core part of numpy... For groupby-like summing over arrays, I use a modified version of numpy.bincount() which has optional arguments that greatly enhance its flexibility: bincount(bin, weights=, max_bins=. out=) where: * bins- numpy array o

Re: [Numpy-discussion] Proposal for new ufunc functionality

2010-04-13 Thread Robert Kern
On Sat, Apr 10, 2010 at 17:59, Robert Kern wrote: > On Sat, Apr 10, 2010 at 12:45, Pauli Virtanen wrote: >> la, 2010-04-10 kello 12:23 -0500, Travis Oliphant kirjoitti: >> [clip] >>> Here are my suggested additions to NumPy: >>> ufunc methods: >> [clip] >>>       * reducein (array, indices, axis=

Re: [Numpy-discussion] Proposal for new ufunc functionality

2010-04-13 Thread josef . pktd
On Tue, Apr 13, 2010 at 10:03 AM, Travis Oliphant wrote: > > On Apr 12, 2010, at 5:31 PM, Robert Kern wrote: > > We should collect all of these proposals into a NEP.      To clarify what I > > mean by "group-by" behavior. > > Suppose I have an array of floats and an array of integers.   Each eleme

Re: [Numpy-discussion] Proposal for new ufunc functionality

2010-04-13 Thread Travis Oliphant
On Apr 12, 2010, at 5:54 PM, Warren Weckesser wrote: A bit more generalization of `by` gives behavior like matlab's accumarray (http://www.mathworks.com/access/helpdesk/help/techdoc/ref/accumarray.html ), which I partly cloned here: [This would be a link to the scipy cookbook, but scipy.org

Re: [Numpy-discussion] Proposal for new ufunc functionality

2010-04-13 Thread Travis Oliphant
On Apr 12, 2010, at 5:31 PM, Robert Kern wrote: We should collect all of these proposals into a NEP. To clarify what I mean by "group-by" behavior. Suppose I have an array of floats and an array of integers. Each element in the array of integers represents a region in the float arra

Re: [Numpy-discussion] Proposal for new ufunc functionality

2010-04-12 Thread Robert Kern
On Mon, Apr 12, 2010 at 17:54, Warren Weckesser wrote: > A bit more generalization of `by` gives behavior like matlab's accumarray > (http://www.mathworks.com/access/helpdesk/help/techdoc/ref/accumarray.html), > which I partly cloned here: > [This would be a link to the scipy cookbook, but scipy.

Re: [Numpy-discussion] Proposal for new ufunc functionality

2010-04-12 Thread Warren Weckesser
Robert Kern wrote: > On Mon, Apr 12, 2010 at 17:26, Travis Oliphant wrote: > >> On Apr 11, 2010, at 2:56 PM, Anne Archibald wrote: >> >> 2010/4/10 Stéfan van der Walt : >> >> On 10 April 2010 19:45, Pauli Virtanen wrote: >> >> Another addition to ufuncs that should be though about is specifyin

Re: [Numpy-discussion] Proposal for new ufunc functionality

2010-04-12 Thread Anne Archibald
On 12 April 2010 18:26, Travis Oliphant wrote: > We should collect all of these proposals into a NEP. Or several NEPs, since I think they are quasi-orthogonal. > To clarify what I > mean by "group-by" behavior. > Suppose I have an array of floats and an array of integers.   Each element > in th

Re: [Numpy-discussion] Proposal for new ufunc functionality

2010-04-12 Thread Robert Kern
On Mon, Apr 12, 2010 at 17:26, Travis Oliphant wrote: > > On Apr 11, 2010, at 2:56 PM, Anne Archibald wrote: > > 2010/4/10 Stéfan van der Walt : > > On 10 April 2010 19:45, Pauli Virtanen wrote: > > Another addition to ufuncs that should be though about is specifying the > > Python-side interface

Re: [Numpy-discussion] Proposal for new ufunc functionality

2010-04-12 Thread Travis Oliphant
On Apr 11, 2010, at 2:56 PM, Anne Archibald wrote: 2010/4/10 Stéfan van der Walt : On 10 April 2010 19:45, Pauli Virtanen wrote: Another addition to ufuncs that should be though about is specifying the Python-side interface to generalized ufuncs. This is an interesting idea; what do you

Re: [Numpy-discussion] Proposal for new ufunc functionality

2010-04-11 Thread Anne Archibald
2010/4/10 Stéfan van der Walt : > On 10 April 2010 19:45, Pauli Virtanen wrote: >> Another addition to ufuncs that should be though about is specifying the >> Python-side interface to generalized ufuncs. > > This is an interesting idea; what do you have in mind? I can see two different kinds of a

Re: [Numpy-discussion] Proposal for new ufunc functionality

2010-04-10 Thread Robert Kern
On Sat, Apr 10, 2010 at 12:45, Pauli Virtanen wrote: > la, 2010-04-10 kello 12:23 -0500, Travis Oliphant kirjoitti: > [clip] >> Here are my suggested additions to NumPy: >> ufunc methods: > [clip] >>       * reducein (array, indices, axis=0) >>                similar to reduce-at, but the indices

Re: [Numpy-discussion] Proposal for new ufunc functionality

2010-04-10 Thread Stéfan van der Walt
On 10 April 2010 19:45, Pauli Virtanen wrote: > Another addition to ufuncs that should be though about is specifying the > Python-side interface to generalized ufuncs. This is an interesting idea; what do you have in mind? Regards Stéfan ___ NumPy-Disc

Re: [Numpy-discussion] Proposal for new ufunc functionality

2010-04-10 Thread josef . pktd
On Sat, Apr 10, 2010 at 1:23 PM, Travis Oliphant wrote: > > Hi, > > I've been mulling over a couple of ideas for new ufunc methods plus a > couple of numpy functions that I think will help implement group-by > operations with NumPy arrays. > > I wanted to discuss them on this list before putting f

Re: [Numpy-discussion] Proposal for new ufunc functionality

2010-04-10 Thread Pauli Virtanen
la, 2010-04-10 kello 12:23 -0500, Travis Oliphant kirjoitti: [clip] > Here are my suggested additions to NumPy: > ufunc methods: [clip] > * reducein (array, indices, axis=0) >similar to reduce-at, but the indices provide both the > start and end points (rather than being fen

[Numpy-discussion] Proposal for new ufunc functionality

2010-04-10 Thread Travis Oliphant
Hi, I've been mulling over a couple of ideas for new ufunc methods plus a couple of numpy functions that I think will help implement group-by operations with NumPy arrays. I wanted to discuss them on this list before putting forward an actual proposal or patch to get input from others. Th