summaryrefslogtreecommitdiff
path: root/numpy/lib/function_base.py
diff options
context:
space:
mode:
authorJulian Taylor <juliantaylor108@gmail.com>2014-03-01 14:47:52 +0100
committerJulian Taylor <juliantaylor108@gmail.com>2014-03-01 14:47:52 +0100
commit24438fbd45e3d858a5ec48e80dd4b87e8d4bdca4 (patch)
treea9b44891b3cd85f29dc429f171ad44fd68e95ca3 /numpy/lib/function_base.py
parente97601d8d35f5221f437efc4434f4d6e2a597cfb (diff)
parentc4c139bba033c420a6edbe585b2846426e3e694c (diff)
downloadnumpy-24438fbd45e3d858a5ec48e80dd4b87e8d4bdca4.tar.gz
Merge pull request #4284 from robquant/histogramdd_rightmost_binedge
Closes issue #4266, fixes histogramdd treatment of events at rightmost binedge
Diffstat (limited to 'numpy/lib/function_base.py')
-rw-r--r--numpy/lib/function_base.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py
index 586c93074..7427545b8 100644
--- a/numpy/lib/function_base.py
+++ b/numpy/lib/function_base.py
@@ -373,10 +373,10 @@ def histogramdd(sample, bins=10, range=None, normed=False, weights=None):
if not np.isinf(mindiff):
decimal = int(-log10(mindiff)) + 6
# Find which points are on the rightmost edge.
- on_edge = where(around(sample[:, i], decimal) ==
- around(edges[i][-1], decimal))[0]
+ not_smaller_than_edge = (sample[:, i] >= edges[i][-1])
+ on_edge = (around(sample[:, i], decimal) == around(edges[i][-1], decimal))
# Shift these points one bin to the left.
- Ncount[i][on_edge] -= 1
+ Ncount[i][where(on_edge & not_smaller_than_edge)[0]] -= 1
# Flattened histogram matrix (1D)
# Reshape is used so that overlarge arrays