[Numpy-svn] r4806 - trunk/numpy/lib

numpy-svn@scip... numpy-svn@scip...
Fri Feb 15 10:20:17 CST 2008


Author: dhuard
Date: 2008-02-15 10:20:15 -0600 (Fri, 15 Feb 2008)
New Revision: 4806

Modified:
   trunk/numpy/lib/function_base.py
Log:
For 4D samples, histogramdd returned badly shaped histograms once in a while. This should be fixed now.

Modified: trunk/numpy/lib/function_base.py
===================================================================
--- trunk/numpy/lib/function_base.py	2008-02-14 07:24:13 UTC (rev 4805)
+++ trunk/numpy/lib/function_base.py	2008-02-15 16:20:15 UTC (rev 4806)
@@ -303,7 +303,7 @@
     # 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 @@
             hist = hist / dedges[i].reshape(shape)
         hist /= s
 
+    if (hist.shape != nbin-2).any():
+        raise 'Internal Shape Error'
     return hist, edges
 
 



More information about the Numpy-svn mailing list