this:
numpy.histogram([1,3,2,3,1,1,1,1,2,3,2,5,6,6],bins=numpy.arange(0,7,1))
yields:
(array([0, 5, 3, 3, 0, 3]), array([0, 1, 2, 3, 4, 5, 6]))
why does it count three 6's? there are only 2!
this:
numpy.histogram([1,3,2,3,1,1,1,1,2,3,2,5,6,6],bins=numpy.arange(0,7,1))
yields:
(array([0, 5, 3, 3, 0, 3]), array([0, 1, 2, 3, 4, 5, 6]))
why does it count three 6's? there are only 2!
It looks like it's lumping the 5's and 6's together - maybe the last bin is 5 to 6, inclusive?
Edit: Looking at the docs, I'm guessing that 6 is the rightmost edge, so values between five and six are in that final bin.
I believe this is related to the semantics of the first and last bins being underflow and overflow. Your total bucket count is correct.
because bins defines the bin edges you need to add one more bin
numpy.histogram([1,3,2,3,1,1,1,1,2,3,2,5,6,6],bins=numpy.arange(0,8,1))