summaryrefslogtreecommitdiff
path: root/numpy/lib/histograms.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/lib/histograms.py')
-rw-r--r--numpy/lib/histograms.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/numpy/lib/histograms.py b/numpy/lib/histograms.py
index 50bafec8c..097df2053 100644
--- a/numpy/lib/histograms.py
+++ b/numpy/lib/histograms.py
@@ -888,13 +888,14 @@ def histogramdd(sample, bins=10, range=None, normed=False, weights=None):
edges[i] = np.linspace(smin[i], smax[i], bins[i] + 1, dtype=edge_dt)
else:
edges[i] = np.asarray(bins[i], edge_dt)
+ # not just monotonic, due to the use of mindiff below
+ if np.any(edges[i][:-1] >= edges[i][1:]):
+ raise ValueError(
+ '`bins[{}]` must be strictly increasing, when an array'
+ .format(i))
+
nbin[i] = len(edges[i]) + 1 # includes an outlier on each end
dedges[i] = np.diff(edges[i])
- # not just monotonic, due to the use of mindiff below
- if np.any(np.asarray(dedges[i]) <= 0):
- raise ValueError(
- '`bins[{}]` must be strictly increasing, when an array'
- .format(i))
nbin = np.asarray(nbin)