summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_function_base.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2007-05-13 23:22:17 +0000
committerCharles Harris <charlesr.harris@gmail.com>2007-05-13 23:22:17 +0000
commit358475343019d2f08d0db5c79b1a59f2f7311a60 (patch)
treeac33a84821686165c2f7198c5bb18eea9228c674 /numpy/lib/tests/test_function_base.py
parent6ec42819ccd70a406f6be8c6f45ae41fd4851f5f (diff)
downloadnumpy-358475343019d2f08d0db5c79b1a59f2f7311a60.tar.gz
Add patch from dhuard to histogramdd. Fixes ticket #509.
Restructure restructured comments; avoid consolidated lists, they are too ugly to contemplate and move around where they aren't wanted. They can be fixed later if epydoc fixes things up.
Diffstat (limited to 'numpy/lib/tests/test_function_base.py')
-rw-r--r--numpy/lib/tests/test_function_base.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py
index c7cc06a45..f0930ae5b 100644
--- a/numpy/lib/tests/test_function_base.py
+++ b/numpy/lib/tests/test_function_base.py
@@ -60,7 +60,7 @@ class test_average(NumpyTestCase):
def check_weighted(self):
y1 = array([[1,2,3],
[4,5,6]])
- actual = average(y1,weights=[1,2],axis=0)
+ actual = average(y1,weights=[1,2],axis=0)
desired = array([3.,4.,5.])
assert_array_equal(actual, desired)
@@ -394,12 +394,12 @@ class test_histogramdd(NumpyTestCase):
Z[range(5), range(5), range(5)] = 1.
H,edges = histogramdd([arange(5), arange(5), arange(5)], 5)
assert_array_equal(H, Z)
-
+
def check_shape(self):
x = rand(100,3)
hist3d, edges = histogramdd(x, bins = (5, 7, 6))
assert_array_equal(hist3d.shape, (5,7,6))
-
+
def check_weights(self):
v = rand(100,2)
hist, edges = histogramdd(v)
@@ -410,7 +410,11 @@ class test_histogramdd(NumpyTestCase):
assert_array_equal(w_hist, n_hist)
w_hist, edges = histogramdd(v, weights=ones(100, int)*2)
assert_array_equal(w_hist, 2*hist)
-
+
+ def check_identical_samples(self):
+ x = zeros((10,2),int)
+ hist, edges = histogramdd(x, bins=2)
+ assert_array_equal(edges[0],array([-0.5, 0. , 0.5]))
class test_unique(NumpyTestCase):
def check_simple(self):