// Using `digitize`, values that fall on an edge are put in the right bin.
// For the rightmost bin, we want values equal to the right
// edge to be counted in the last bin, and not as an outlier.
exceptions = (RuntimeWarning,)
if sys.version_info >= (3, 8):
exceptions += (OverflowError,) // Python3.8 int(np.inf) throws this
for i in xrange(Ndim):
// Find the rounding precision
try:
After Change
dedges_min = dedges[i].min()
if dedges_min == 0:
raise ValueError("The smallest edge difference is numerically 0.")
decimal = int(-np.log10(dedges_min)) + 6
// Find which points are on the rightmost edge.
on_edge = np.where(np.around(sample[:, i], decimal) ==
np.around(edges[i][-1], decimal))[0]