diff options
Diffstat (limited to 'numpy/lib/tests/test_twodim_base.py')
-rw-r--r-- | numpy/lib/tests/test_twodim_base.py | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/numpy/lib/tests/test_twodim_base.py b/numpy/lib/tests/test_twodim_base.py index 00501135c..d3a072af3 100644 --- a/numpy/lib/tests/test_twodim_base.py +++ b/numpy/lib/tests/test_twodim_base.py @@ -244,32 +244,32 @@ class TestHistogram2d(object): def test_binparameter_combination(self): x = array( - [0, 0.09207008, 0.64575234, 0.12875982, 0.47390599, + [0, 0.09207008, 0.64575234, 0.12875982, 0.47390599, 0.59944483, 1]) y = array( - [0, 0.14344267, 0.48988575, 0.30558665, 0.44700682, + [0, 0.14344267, 0.48988575, 0.30558665, 0.44700682, 0.15886423, 1]) edges = (0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1) H, xe, ye = histogram2d(x, y, (edges, 4)) answer = array( - [[ 2., 0., 0., 0.], - [ 0., 1., 0., 0.], - [ 0., 0., 0., 0.], - [ 0., 0., 0., 0.], - [ 0., 1., 0., 0.], - [ 1., 0., 0., 0.], - [ 0., 1., 0., 0.], - [ 0., 0., 0., 0.], - [ 0., 0., 0., 0.], - [ 0., 0., 0., 1.]]) + [[2., 0., 0., 0.], + [0., 1., 0., 0.], + [0., 0., 0., 0.], + [0., 0., 0., 0.], + [0., 1., 0., 0.], + [1., 0., 0., 0.], + [0., 1., 0., 0.], + [0., 0., 0., 0.], + [0., 0., 0., 0.], + [0., 0., 0., 1.]]) assert_array_equal(H, answer) assert_array_equal(ye, array([0., 0.25, 0.5, 0.75, 1])) H, xe, ye = histogram2d(x, y, (4, edges)) answer = array( - [[ 1., 1., 0., 1., 0., 0., 0., 0., 0., 0.], - [ 0., 0., 0., 0., 1., 0., 0., 0., 0., 0.], - [ 0., 1., 0., 0., 1., 0., 0., 0., 0., 0.], - [ 0., 0., 0., 0., 0., 0., 0., 0., 0., 1.]]) + [[1., 1., 0., 1., 0., 0., 0., 0., 0., 0.], + [0., 0., 0., 0., 1., 0., 0., 0., 0., 0.], + [0., 1., 0., 0., 1., 0., 0., 0., 0., 0.], + [0., 0., 0., 0., 0., 0., 0., 0., 0., 1.]]) assert_array_equal(H, answer) assert_array_equal(xe, array([0., 0.25, 0.5, 0.75, 1])) @@ -319,6 +319,7 @@ def test_tril_triu_ndim3(): assert_equal(a_triu_observed.dtype, a.dtype) assert_equal(a_tril_observed.dtype, a.dtype) + def test_tril_triu_with_inf(): # Issue 4859 arr = np.array([[1, 1, np.inf], |