summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_function_base.py
diff options
context:
space:
mode:
authorEric Jones <eric@enthought.com>2007-04-11 02:09:59 +0000
committerEric Jones <eric@enthought.com>2007-04-11 02:09:59 +0000
commit1453e759c5c5f2c37309ee0c3b867ff6da2fcaf0 (patch)
treefeecf6234f53ed210428fa9d2f3658a854950221 /numpy/lib/tests/test_function_base.py
parent98ab993945def2a5ad44e3f8d5d65c57c449ba28 (diff)
downloadnumpy-1453e759c5c5f2c37309ee0c3b867ff6da2fcaf0.tar.gz
added simple test for weighted average
Diffstat (limited to 'numpy/lib/tests/test_function_base.py')
-rw-r--r--numpy/lib/tests/test_function_base.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py
index a8d9296a6..c7cc06a45 100644
--- a/numpy/lib/tests/test_function_base.py
+++ b/numpy/lib/tests/test_function_base.py
@@ -57,6 +57,13 @@ class test_average(NumpyTestCase):
assert_array_equal(y5.mean(0), average(y5, 0))
assert_array_equal(y5.mean(1), average(y5, 1))
+ def check_weighted(self):
+ y1 = array([[1,2,3],
+ [4,5,6]])
+ actual = average(y1,weights=[1,2],axis=0)
+ desired = array([3.,4.,5.])
+ assert_array_equal(actual, desired)
+
class test_logspace(NumpyTestCase):
def check_basic(self):
y = logspace(0,6)