summaryrefslogtreecommitdiff
path: root/numpy/lib/function_base.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2008-03-16 17:08:32 +0000
committerCharles Harris <charlesr.harris@gmail.com>2008-03-16 17:08:32 +0000
commit07ed95fe7749820558abbf08b51f74bb3f014984 (patch)
treefa7a13f70035910764217c0c4d89b433c168d9f2 /numpy/lib/function_base.py
parent345b13d6c8e023fb4c449cf5df2b140de2ce48ec (diff)
downloadnumpy-07ed95fe7749820558abbf08b51f74bb3f014984.tar.gz
Change ValueError to TypeError in average
Diffstat (limited to 'numpy/lib/function_base.py')
-rw-r--r--numpy/lib/function_base.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py
index c85aad451..07a69e762 100644
--- a/numpy/lib/function_base.py
+++ b/numpy/lib/function_base.py
@@ -368,7 +368,7 @@ def average(a, axis=None, weights=None, returned=False):
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 @@ def average(a, axis=None, weights=None, returned=False):
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"