[Numpy-discussion] Histgrom density estimation (density kwarg) with out of range values
sebastian at sipsolutions.net
Fri May 31 16:45:46 EDT 2019
unfortunately it was noticed in Issue 13604  that when histogram is
given used with a specified range and the `density=True` keyword
argument out of bound values are simply discarded .
Discarding out of bound values makes sense when the density/normed
option is not used, since in that case event counts are reported.
However, when out of bound values exist, the probability density should
arguably not sum up to 1 anymore.
We seem to have three ways possible to continue here:
1. Call it an outright bug and fix it.
2. Add a FutureWarning, and change it later (unfortunately noisy)
3. Add a new kwarg to control what happens and a FutureWarning which
can be silenced using the new kwarg.
(No change will ever happen if `range` or manual bin edges were not
If all agree that there is no reasonable use case for the current
implementation, it would be tempting to simply change it, or use a
FutureWarning (unfortunately forcing users to manually calculate the
density). If there is any half-decent use case, the kwarg may be the
Personally, if no one finds has a use case, I am slightly tending
towards the "bug fix" option right now.
All the Best,
 As mentioned in the documentation.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 833 bytes
Desc: This is a digitally signed message part
More information about the NumPy-Discussion