[Numpy-discussion] Ticket #605 Incorrect behavior of numpy.histogram

Hans Meine meine at informatik.uni-hamburg.de
Mon Apr 7 08:34:08 EDT 2008


Am Samstag, 05. April 2008 21:54:27 schrieb Anne Archibald:
> There's also a fourth option - raise an exception if any points are
> outside the range.

+1

I think this should be the default.  Otherwise, I tend towards "exclude", in 
order to have comparable bin sizes (when plotting, I always find peaks at the 
ends annoying); this could also be called "clip" BTW.

But really, an exception would follow the Zen: "In the face of ambiguity, 
refuse the temptation to guess."  And with a kwarg: "Explicit is better than 
implicit."

histogram(a, arange(10), outliers = "clip")
histogram(a, arange(10), outliers = "include")
# better names? "include"->"accumulate"/"map to border"/"map"/"boundary"

-- 
Ciao, /  /
     /--/
    /  / ANS



More information about the NumPy-Discussion mailing list