Re: [Numpy-discussion] numpy histogram normed=True (bug / confusing behavior)

2010-08-31 Thread Ralf Gommers
On Tue, Aug 31, 2010 at 3:44 AM, David Huard david.hu...@gmail.com wrote: I just added a warning alerting concerned users (r8674), so this takes care of the bug fix and Nils wish to avoid a silent change in behavior. These two changes could be included in 1.5 if Ralf feels this is worthwhile.

Re: [Numpy-discussion] numpy histogram normed=True (bug / confusing behavior)

2010-08-31 Thread David Huard
On Tue, Aug 31, 2010 at 7:02 AM, Ralf Gommers ralf.gomm...@googlemail.comwrote: On Tue, Aug 31, 2010 at 3:44 AM, David Huard david.hu...@gmail.comwrote: I just added a warning alerting concerned users (r8674), so this takes care of the bug fix and Nils wish to avoid a silent change in

Re: [Numpy-discussion] numpy histogram normed=True (bug / confusing behavior)

2010-08-31 Thread Ralf Gommers
On Tue, Aug 31, 2010 at 10:13 PM, David Huard david.hu...@gmail.com wrote: On Tue, Aug 31, 2010 at 7:02 AM, Ralf Gommers ralf.gomm...@googlemail.com wrote: On Tue, Aug 31, 2010 at 3:44 AM, David Huard david.hu...@gmail.comwrote: I just added a warning alerting concerned users (r8674),

Re: [Numpy-discussion] numpy histogram normed=True (bug / confusing behavior)

2010-08-30 Thread David Huard
Thanks for the feedback, As far as I understand it, the proposition is to keep histogram as it is for 1.5, then in 2.0, deprecate normed=True but keep the buggy behavior, while adding a density keyword that fixes the bug. In a later release, we could then get rid of normed. While the bug won't be

Re: [Numpy-discussion] numpy histogram normed=True (bug / confusing behavior)

2010-08-30 Thread Benjamin Root
On Mon, Aug 30, 2010 at 8:29 AM, David Huard david.hu...@gmail.com wrote: Thanks for the feedback, As far as I understand it, the proposition is to keep histogram as it is for 1.5, then in 2.0, deprecate normed=True but keep the buggy behavior, while adding a density keyword that fixes the

Re: [Numpy-discussion] numpy histogram normed=True (bug / confusing behavior)

2010-08-30 Thread Bruce Southey
On 08/30/2010 09:19 AM, Benjamin Root wrote: On Mon, Aug 30, 2010 at 8:29 AM, David Huard david.hu...@gmail.com mailto:david.hu...@gmail.com wrote: Thanks for the feedback, As far as I understand it, the proposition is to keep histogram as it is for 1.5, then in 2.0, deprecate

Re: [Numpy-discussion] numpy histogram normed=True (bug / confusing behavior)

2010-08-30 Thread josef . pktd
On Mon, Aug 30, 2010 at 11:39 AM, Bruce Southey bsout...@gmail.com wrote: On 08/30/2010 09:19 AM, Benjamin Root wrote: On Mon, Aug 30, 2010 at 8:29 AM, David Huard david.hu...@gmail.com wrote: Thanks for the feedback, As far as I understand it, the proposition is to keep histogram as it is

Re: [Numpy-discussion] numpy histogram normed=True (bug / confusing behavior)

2010-08-30 Thread David Huard
I tend to agree with Josef here, To me, bincount and digitize are the low-level functions, and histogram contains a bit more functionality since its used so often and for many use cases. My guess is that if we removed the normalization, it could annoy a lot of people and would quickly appear on

Re: [Numpy-discussion] numpy histogram normed=True (bug / confusing behavior)

2010-08-30 Thread Nils Becker
I think (a corrected) density histogram is core functionality for unequal bin lengths. The graph with raw count in the case of unequal bin sizes would be quite misleading when plotted and interpreted on the real line and not on discrete points (shaded areas instead of vertical lines). And

Re: [Numpy-discussion] numpy histogram normed=True (bug / confusing behavior)

2010-08-30 Thread Benjamin Root
On Mon, Aug 30, 2010 at 10:50 AM, josef.p...@gmail.com wrote: On Mon, Aug 30, 2010 at 11:39 AM, Bruce Southey bsout...@gmail.com wrote: On 08/30/2010 09:19 AM, Benjamin Root wrote: On Mon, Aug 30, 2010 at 8:29 AM, David Huard david.hu...@gmail.com wrote: Thanks for the feedback, As

Re: [Numpy-discussion] numpy histogram normed=True (bug / confusing behavior)

2010-08-30 Thread josef . pktd
On Mon, Aug 30, 2010 at 2:43 PM, Benjamin Root ben.r...@ou.edu wrote: On Mon, Aug 30, 2010 at 10:50 AM, josef.p...@gmail.com wrote: On Mon, Aug 30, 2010 at 11:39 AM, Bruce Southey bsout...@gmail.com wrote: On 08/30/2010 09:19 AM, Benjamin Root wrote: On Mon, Aug 30, 2010 at 8:29 AM,

Re: [Numpy-discussion] numpy histogram normed=True (bug / confusing behavior)

2010-08-30 Thread David Huard
On Mon, Aug 30, 2010 at 3:02 PM, josef.p...@gmail.com wrote: On Mon, Aug 30, 2010 at 2:43 PM, Benjamin Root ben.r...@ou.edu wrote: On Mon, Aug 30, 2010 at 10:50 AM, josef.p...@gmail.com wrote: On Mon, Aug 30, 2010 at 11:39 AM, Bruce Southey bsout...@gmail.com wrote: On 08/30/2010

Re: [Numpy-discussion] numpy histogram normed=True (bug / confusing behavior)

2010-08-30 Thread josef . pktd
On Mon, Aug 30, 2010 at 3:44 PM, David Huard david.hu...@gmail.com wrote: On Mon, Aug 30, 2010 at 3:02 PM, josef.p...@gmail.com wrote: On Mon, Aug 30, 2010 at 2:43 PM, Benjamin Root ben.r...@ou.edu wrote: On Mon, Aug 30, 2010 at 10:50 AM, josef.p...@gmail.com wrote: On Mon, Aug 30, 2010

Re: [Numpy-discussion] numpy histogram normed=True (bug / confusing behavior)

2010-08-29 Thread Nils Becker
On Sat, Aug 28, 2010 at 04:12, Zbyszek Szmek zbys...@in.waw.pl wrote: Hi, On Fri, Aug 27, 2010 at 06:43:26PM -0600, Charles R Harris wrote: ? ?On Fri, Aug 27, 2010 at 2:47 PM, Robert Kern robert.k...@gmail.com ? ?wrote: ? ? ?On Fri, Aug 27, 2010 at 15:32, David Huard david.hu...@gmail.com

Re: [Numpy-discussion] numpy histogram normed=True (bug / confusing behavior)

2010-08-29 Thread Ralf Gommers
On Sat, Aug 28, 2010 at 4:32 AM, David Huard david.hu...@gmail.com wrote: Nils and Joseph, Thanks for the bug report, this is now fixed in SVN (r8672). Ralph. is this something that you want to see backported in 1.5 ? From the other replies to your mail I gather your bug fix is still going

Re: [Numpy-discussion] numpy histogram normed=True (bug / confusing behavior)

2010-08-29 Thread josef . pktd
On Sun, Aug 29, 2010 at 10:26 AM, Ralf Gommers ralf.gomm...@googlemail.com wrote: On Sat, Aug 28, 2010 at 4:32 AM, David Huard david.hu...@gmail.com wrote: Nils and Joseph, Thanks for the bug report, this is now fixed in SVN (r8672). Ralph. is this something that you want to see backported

Re: [Numpy-discussion] numpy histogram normed=True (bug / confusing behavior)

2010-08-29 Thread Sebastian Haase
On Sun, Aug 29, 2010 at 3:21 PM, Nils Becker n.bec...@amolf.nl wrote: On Sat, Aug 28, 2010 at 04:12, Zbyszek Szmek zbys...@in.waw.pl wrote: Hi, On Fri, Aug 27, 2010 at 06:43:26PM -0600, Charles R Harris wrote: ? ?On Fri, Aug 27, 2010 at 2:47 PM, Robert Kern robert.k...@gmail.com ? ?wrote:

Re: [Numpy-discussion] numpy histogram normed=True (bug / confusing behavior)

2010-08-28 Thread Zbyszek Szmek
Hi, On Fri, Aug 27, 2010 at 06:43:26PM -0600, Charles R Harris wrote: On Fri, Aug 27, 2010 at 2:47 PM, Robert Kern robert.k...@gmail.com wrote: On Fri, Aug 27, 2010 at 15:32, David Huard david.hu...@gmail.com wrote: Nils and Joseph, Thanks for the bug report,

Re: [Numpy-discussion] numpy histogram normed=True (bug / confusing behavior)

2010-08-28 Thread Robert Kern
On Sat, Aug 28, 2010 at 04:12, Zbyszek Szmek zbys...@in.waw.pl wrote: Hi, On Fri, Aug 27, 2010 at 06:43:26PM -0600, Charles R Harris wrote:    On Fri, Aug 27, 2010 at 2:47 PM, Robert Kern robert.k...@gmail.com    wrote:      On Fri, Aug 27, 2010 at 15:32, David Huard david.hu...@gmail.com  

Re: [Numpy-discussion] numpy histogram normed=True (bug / confusing behavior)

2010-08-27 Thread David Huard
Nils and Joseph, Thanks for the bug report, this is now fixed in SVN (r8672). Ralph. is this something that you want to see backported in 1.5 ? Regards, David On Fri, Aug 6, 2010 at 7:49 PM, josef.p...@gmail.com wrote: On Fri, Aug 6, 2010 at 4:53 PM, Nils Becker n.bec...@amolf.nl wrote:

Re: [Numpy-discussion] numpy histogram normed=True (bug / confusing behavior)

2010-08-27 Thread Robert Kern
On Fri, Aug 27, 2010 at 15:32, David Huard david.hu...@gmail.com wrote: Nils and Joseph, Thanks for the bug report, this is now fixed in SVN (r8672). While we're at it, can we change the name of the argument? normed has caused so much confusion over the years. We could deprecate normed=True in

Re: [Numpy-discussion] numpy histogram normed=True (bug / confusing behavior)

2010-08-27 Thread Charles R Harris
On Fri, Aug 27, 2010 at 2:47 PM, Robert Kern robert.k...@gmail.com wrote: On Fri, Aug 27, 2010 at 15:32, David Huard david.hu...@gmail.com wrote: Nils and Joseph, Thanks for the bug report, this is now fixed in SVN (r8672). While we're at it, can we change the name of the argument? normed

[Numpy-discussion] numpy histogram normed=True (bug / confusing behavior)

2010-08-06 Thread Nils Becker
Hi, I found what looks like a bug in histogram, when the option normed=True is used together with non-uniform bins. Consider this example: import numpy as np data = np.array([1, 2, 3, 4]) bins = np.array([.5, 1.5, 4.5]) bin_widths = np.diff(bins) (counts, dummy) = np.histogram(data, bins)

Re: [Numpy-discussion] numpy histogram normed=True (bug / confusing behavior)

2010-08-06 Thread josef . pktd
On Fri, Aug 6, 2010 at 11:46 AM, Nils Becker n.bec...@amolf.nl wrote: Hi, I found what looks like a bug in histogram, when the option normed=True is used together with non-uniform bins. Consider this example: import numpy as np data = np.array([1, 2, 3, 4]) bins = np.array([.5, 1.5,

Re: [Numpy-discussion] numpy histogram normed=True (bug / confusing behavior)

2010-08-06 Thread Nils Becker
Hi again, first a correction: I posted I believe np.histogram(data, bins, normed=True) effectively does : np.histogram(data, bins, normed=False) / (bins[-1] - bins[0]). However, it _should_ do np.histogram(data, bins, normed=False) / bins_widths but there is a normalization missing; it

Re: [Numpy-discussion] numpy histogram normed=True (bug / confusing behavior)

2010-08-06 Thread josef . pktd
On Fri, Aug 6, 2010 at 4:53 PM, Nils Becker n.bec...@amolf.nl wrote: Hi again, first a correction: I posted I believe np.histogram(data, bins, normed=True) effectively does : np.histogram(data, bins, normed=False) / (bins[-1] - bins[0]). However, it _should_ do np.histogram(data, bins,