summaryrefslogtreecommitdiff
path: root/numpy/lib/function_base.py
diff options
context:
space:
mode:
authordhuard <dhuard@localhost>2008-02-15 16:20:15 +0000
committerdhuard <dhuard@localhost>2008-02-15 16:20:15 +0000
commit5cc1b4eda40d6310096757518f9abd6ca298d1cd (patch)
tree05082f6d00b2546ba1a0c8745e21367f8b244462 /numpy/lib/function_base.py
parentb46333fb1152537cde127db62cf5246d960df530 (diff)
downloadnumpy-5cc1b4eda40d6310096757518f9abd6ca298d1cd.tar.gz
For 4D samples, histogramdd returned badly shaped histograms once in a while. This should be fixed now.
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