@@ -265,6 +265,37 @@ def test_empty(self):
265265 a , edge1 , edge2 = histogram2d ([], [], bins = 4 )
266266 assert_array_max_ulp (a , np .zeros ((4 , 4 )))
267267
268+ def test_binparameter_combination (self ):
269+ x = array (
270+ [0 , 0.09207008 , 0.64575234 , 0.12875982 , 0.47390599 ,
271+ 0.59944483 , 1 ])
272+ y = array (
273+ [0 , 0.14344267 , 0.48988575 , 0.30558665 , 0.44700682 ,
274+ 0.15886423 , 1 ])
275+ edges = (0 , 0.1 , 0.2 , 0.3 , 0.4 , 0.5 , 0.6 , 0.7 , 0.8 , 0.9 , 1 )
276+ H , xe , ye = histogram2d (x , y , (edges , 4 ))
277+ answer = array (
278+ [[ 2. , 0. , 0. , 0. ],
279+ [ 0. , 1. , 0. , 0. ],
280+ [ 0. , 0. , 0. , 0. ],
281+ [ 0. , 0. , 0. , 0. ],
282+ [ 0. , 1. , 0. , 0. ],
283+ [ 1. , 0. , 0. , 0. ],
284+ [ 0. , 1. , 0. , 0. ],
285+ [ 0. , 0. , 0. , 0. ],
286+ [ 0. , 0. , 0. , 0. ],
287+ [ 0. , 0. , 0. , 1. ]])
288+ assert_array_equal (H , answer )
289+ assert_array_equal (ye , array ([0. , 0.25 , 0.5 , 0.75 , 1 ]))
290+ H , xe , ye = histogram2d (x , y , (4 , edges ))
291+ answer = array (
292+ [[ 1. , 1. , 0. , 1. , 0. , 0. , 0. , 0. , 0. , 0. ],
293+ [ 0. , 0. , 0. , 0. , 1. , 0. , 0. , 0. , 0. , 0. ],
294+ [ 0. , 1. , 0. , 0. , 1. , 0. , 0. , 0. , 0. , 0. ],
295+ [ 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 1. ]])
296+ assert_array_equal (H , answer )
297+ assert_array_equal (xe , array ([0. , 0.25 , 0.5 , 0.75 , 1 ]))
298+
268299
269300class TestTri (TestCase ):
270301 def test_dtype (self ):
0 commit comments