summaryrefslogtreecommitdiff
path: root/numpy/lib/function_base.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/lib/function_base.py')
-rw-r--r--numpy/lib/function_base.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py
index c8425bb8c..beb3a995c 100644
--- a/numpy/lib/function_base.py
+++ b/numpy/lib/function_base.py
@@ -303,7 +303,7 @@ def histogramdd(sample, bins=10, range=None, normed=False, weights=None):
# Shape into a proper matrix
hist = hist.reshape(sort(nbin))
for i in arange(nbin.size):
- j = ni[i]
+ j = ni.argsort()[i]
hist = hist.swapaxes(i,j)
ni[i],ni[j] = ni[j],ni[i]
@@ -320,6 +320,8 @@ def histogramdd(sample, bins=10, range=None, normed=False, weights=None):
hist = hist / dedges[i].reshape(shape)
hist /= s
+ if (hist.shape != nbin-2).any():
+ raise 'Internal Shape Error'
return hist, edges