Re: [Numpy-discussion] Histogram bin definition

2008-07-16 Thread David Huard
Hi Stefan, It's designed this way. The main reason is that the default bin edges are generated using linspace(a.min(), a.max(), bin) when bin is an integer. If we leave the rightmost edge open, then the histogram of a 100 items array will typically yield an histogram with 99 values because the

[Numpy-discussion] Histogram bin definition

2008-07-16 Thread Stéfan van der Walt
Hi all, I am busy documenting `histogram`, and the definition of a "bin" eludes me. Here is the behaviour that troubles me: >>> np.histogram([1,2,1], bins=[0, 1, 2, 3], new=True) (array([0, 2, 1]), array([0, 1, 2, 3])) >From this result, it seems as if a bin is defined as the half-open interval