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

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 array

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

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 oliph...@enthought.com 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.

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

2010-04-13 Thread Robert Kern
On Sat, Apr 10, 2010 at 17:59, Robert Kern robert.k...@gmail.com wrote: On Sat, Apr 10, 2010 at 12:45, Pauli Virtanen p...@iki.fi wrote: la, 2010-04-10 kello 12:23 -0500, Travis Oliphant kirjoitti: [clip] Here are my suggested additions to NumPy: ufunc methods: [clip]       * reducein

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 ste...@sun.ac.za: On 10 April 2010 19:45, Pauli Virtanen p...@iki.fi wrote: Another addition to ufuncs that should be though about is specifying the Python-side interface to generalized ufuncs. This is an

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

2010-04-12 Thread Robert Kern
On Mon, Apr 12, 2010 at 17:26, Travis Oliphant oliph...@enthought.com wrote: On Apr 11, 2010, at 2:56 PM, Anne Archibald wrote: 2010/4/10 Stéfan van der Walt ste...@sun.ac.za: On 10 April 2010 19:45, Pauli Virtanen p...@iki.fi wrote: Another addition to ufuncs that should be though about

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

2010-04-12 Thread Anne Archibald
On 12 April 2010 18:26, Travis Oliphant oliph...@enthought.com 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.  

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 oliph...@enthought.com wrote: On Apr 11, 2010, at 2:56 PM, Anne Archibald wrote: 2010/4/10 Stéfan van der Walt ste...@sun.ac.za: On 10 April 2010 19:45, Pauli Virtanen p...@iki.fi wrote: Another addition to ufuncs that

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

2010-04-12 Thread Robert Kern
On Mon, Apr 12, 2010 at 17:54, Warren Weckesser warren.weckes...@enthought.com 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

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

2010-04-11 Thread Anne Archibald
2010/4/10 Stéfan van der Walt ste...@sun.ac.za: On 10 April 2010 19:45, Pauli Virtanen p...@iki.fi 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

[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.

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

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 oliph...@enthought.com 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

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 p...@iki.fi 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 ___

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

2010-04-10 Thread Robert Kern
On Sat, Apr 10, 2010 at 12:45, Pauli Virtanen p...@iki.fi 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