summaryrefslogtreecommitdiff
path: root/numpy/lib/histograms.py
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2018-03-26 00:16:27 -0700
committerEric Wieser <wieser.eric@gmail.com>2018-03-26 00:50:30 -0700
commit88a564e81ba3b4eba7e1cd864e2ef68a39b572d1 (patch)
treeb214b1cd55f0958b9b80395c2c7c43790da350ac /numpy/lib/histograms.py
parente4d678a2f5859d29a853d617e9e5bbd4b6241898 (diff)
downloadnumpy-88a564e81ba3b4eba7e1cd864e2ef68a39b572d1.tar.gz
MAINT: Make np.histogramdd error messages consistent with np.histogram
Diffstat (limited to 'numpy/lib/histograms.py')
-rw-r--r--numpy/lib/histograms.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/numpy/lib/histograms.py b/numpy/lib/histograms.py
index aa067a431..c17683c7c 100644
--- a/numpy/lib/histograms.py
+++ b/numpy/lib/histograms.py
@@ -884,18 +884,18 @@ def histogramdd(sample, bins=10, range=None, normed=False, weights=None):
if np.isscalar(bins[i]):
if bins[i] < 1:
raise ValueError(
- "Element at index %s in `bins` should be a positive "
- "integer." % i)
+ '`bins[{}]` must be positive, when an integer'.format(i))
nbin[i] = bins[i] + 2 # +2 for outlier bins
edges[i] = np.linspace(smin[i], smax[i], nbin[i]-1, dtype=edge_dt)
else:
edges[i] = np.asarray(bins[i], edge_dt)
nbin[i] = len(edges[i]) + 1 # +1 for outlier bins
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(
- "Found bin edge of size <= 0. Did you specify `bins` with"
- "non-monotonic sequence?")
+ '`bins[{}]` must be strictly increasing, when an array'
+ .format(i))
nbin = np.asarray(nbin)