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

numpy-svn at scipy.org numpy-svn at scipy.org
Sun Mar 16 13:08:35 EDT 2008


Author: charris
Date: 2008-03-16 12:08:32 -0500 (Sun, 16 Mar 2008)
New Revision: 4878

Modified:
   trunk/numpy/lib/function_base.py
Log:
Change ValueError to TypeError in average


Modified: trunk/numpy/lib/function_base.py
===================================================================
--- trunk/numpy/lib/function_base.py	2008-03-16 16:59:08 UTC (rev 4877)
+++ trunk/numpy/lib/function_base.py	2008-03-16 17:08:32 UTC (rev 4878)
@@ -368,7 +368,7 @@
     ZeroDivisionError
         Results when all weights are zero.if appropriate. The version in MA
         does not, it returns masked values.
-    ValueError
+    TypeError
         Results when both an axis and weights are specified and the weights are
         not an 1D array.
 
@@ -399,7 +399,7 @@
         wgt = np.array(weights, dtype=a.dtype, copy=0)
         scl = wgt.sum()
         if axis is not None and wgt.ndim != 1 :
-            raise ValueError, 'Weights must be 1D when axis is specified'
+            raise TypeError, 'Weights must be 1D when axis is specified'
         if scl == 0.0:
             raise ZeroDivisionError, "Weights sum to zero, can't be normalized"
 




More information about the Numpy-svn mailing list