Re: [Numpy-discussion] Initial implementation of histogram_discrete()

2009-11-16 Thread Bruce Southey
On 11/15/2009 01:16 AM, David Warde-Farley wrote: On 14-Nov-09, at 10:57 AM, Bruce Southey wrote: Is it just that bincount does not count negative numbers? If so, then I would strongly argue that is insufficient for creating new function. Rather you need to provide a suitable patch to

Re: [Numpy-discussion] Initial implementation of histogram_discrete()

2009-11-14 Thread Priit Laes
Ühel kenal päeval, R, 2009-11-13 kell 13:36, kirjutas Ernest Adrogué: 13/11/09 @ 09:41 (+0200), thus spake Priit Laes: Does anyone have a scenario where one would actually have both negative and positive numbers (integers) in the list? Yes: when you have a random variable that is the

Re: [Numpy-discussion] Initial implementation of histogram_discrete()

2009-11-14 Thread josef . pktd
On Sat, Nov 14, 2009 at 6:53 AM, Priit Laes pl...@plaes.org wrote: Ühel kenal päeval, R, 2009-11-13 kell 13:36, kirjutas Ernest Adrogué: 13/11/09 @ 09:41 (+0200), thus spake Priit Laes: Does anyone have a scenario where one would actually have both negative and positive numbers (integers) in

Re: [Numpy-discussion] Initial implementation of histogram_discrete()

2009-11-14 Thread josef . pktd
On Sat, Nov 14, 2009 at 7:10 AM, josef.p...@gmail.com wrote: On Sat, Nov 14, 2009 at 6:53 AM, Priit Laes pl...@plaes.org wrote: Ühel kenal päeval, R, 2009-11-13 kell 13:36, kirjutas Ernest Adrogué: 13/11/09 @ 09:41 (+0200), thus spake Priit Laes: Does anyone have a scenario where one would

Re: [Numpy-discussion] Initial implementation of histogram_discrete()

2009-11-14 Thread Bruce Southey
On Sat, Nov 14, 2009 at 6:40 AM, josef.p...@gmail.com wrote: On Sat, Nov 14, 2009 at 7:10 AM,  josef.p...@gmail.com wrote: On Sat, Nov 14, 2009 at 6:53 AM, Priit Laes pl...@plaes.org wrote: Ühel kenal päeval, R, 2009-11-13 kell 13:36, kirjutas Ernest Adrogué: 13/11/09 @ 09:41 (+0200), thus

Re: [Numpy-discussion] Initial implementation of histogram_discrete()

2009-11-14 Thread David Warde-Farley
On 14-Nov-09, at 10:57 AM, Bruce Southey wrote: Is it just that bincount does not count negative numbers? If so, then I would strongly argue that is insufficient for creating new function. Rather you need to provide a suitable patch to fix bincount or replace bincount with a better version.

Re: [Numpy-discussion] Initial implementation of histogram_discrete()

2009-11-13 Thread Ernest Adrogué
13/11/09 @ 09:41 (+0200), thus spake Priit Laes: Does anyone have a scenario where one would actually have both negative and positive numbers (integers) in the list? Yes: when you have a random variable that is the difference of two (discrete) random variables. For example, if you measure the

[Numpy-discussion] Initial implementation of histogram_discrete()

2009-11-12 Thread Priit Laes
Hey, I cooked up an initial implementation for one-dimensional histogram_discrete(). Example: import numpy numpy.histogram_discrete([-1, 9, 9, 0, 3, 5, 3]) array([1, 1, 0, 0, 2, 0, 1, 0, 0, 0, 2]) numpy.histogram_discrete([-9, 9]) array([1, 0, 0, ..., 0, 0, 1]) Suggestions,

Re: [Numpy-discussion] Initial implementation of histogram_discrete()

2009-11-12 Thread josef . pktd
On Thu, Nov 12, 2009 at 6:00 PM, Priit Laes pl...@plaes.org wrote: Hey, I cooked up an initial implementation for one-dimensional histogram_discrete(). Example: import numpy numpy.histogram_discrete([-1, 9, 9, 0, 3, 5, 3]) array([1, 1, 0, 0, 2, 0, 1, 0, 0, 0, 2])

Re: [Numpy-discussion] Initial implementation of histogram_discrete()

2009-11-12 Thread David Warde-Farley
On 12-Nov-09, at 6:09 PM, josef.p...@gmail.com wrote: On Thu, Nov 12, 2009 at 6:00 PM, Priit Laes pl...@plaes.org wrote: Hey, I cooked up an initial implementation for one-dimensional histogram_discrete(). Example: import numpy numpy.histogram_discrete([-1, 9, 9, 0, 3, 5, 3]) array([1,

Re: [Numpy-discussion] Initial implementation of histogram_discrete()

2009-11-12 Thread josef . pktd
On Thu, Nov 12, 2009 at 6:16 PM, David Warde-Farley d...@cs.toronto.edu wrote: On 12-Nov-09, at 6:09 PM, josef.p...@gmail.com wrote: On Thu, Nov 12, 2009 at 6:00 PM, Priit Laes pl...@plaes.org wrote: Hey, I cooked up an initial implementation for one-dimensional histogram_discrete().

Re: [Numpy-discussion] Initial implementation of histogram_discrete()

2009-11-12 Thread Robert Kern
On Thu, Nov 12, 2009 at 17:25, josef.p...@gmail.com wrote: If I could make a related wish, I wish np.bincount to take also a 2d array as weights. It does. -- Robert Kern I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt

Re: [Numpy-discussion] Initial implementation of histogram_discrete()

2009-11-12 Thread josef . pktd
On Thu, Nov 12, 2009 at 6:31 PM, Robert Kern robert.k...@gmail.com wrote: On Thu, Nov 12, 2009 at 17:25,  josef.p...@gmail.com wrote: If I could make a related wish, I wish np.bincount to take also a 2d array as weights. It does. If it does, I don't manage to make it work, and the new docs

Re: [Numpy-discussion] Initial implementation of histogram_discrete()

2009-11-12 Thread Robert Kern
On Thu, Nov 12, 2009 at 20:12, josef.p...@gmail.com wrote: On Thu, Nov 12, 2009 at 6:31 PM, Robert Kern robert.k...@gmail.com wrote: On Thu, Nov 12, 2009 at 17:25,  josef.p...@gmail.com wrote: If I could make a related wish, I wish np.bincount to take also a 2d array as weights. It does.

Re: [Numpy-discussion] Initial implementation of histogram_discrete()

2009-11-12 Thread Priit Laes
Ühel kenal päeval, N, 2009-11-12 kell 18:16, kirjutas David Warde-Farley: On 12-Nov-09, at 6:09 PM, josef.p...@gmail.com wrote: On Thu, Nov 12, 2009 at 6:00 PM, Priit Laes pl...@plaes.org wrote: Hey, I cooked up an initial implementation for one-dimensional histogram_discrete().