#NEWLINE# def test_entropy( self ) : #NEWLINE# #INDENT# hg = stats . hypergeom ( 4 , 1 , 1 ) #NEWLINE# h = hg . entropy ( ) #NEWLINE# expected_p = np . array ( [ 0.75 , 0.25 ] ) #NEWLINE# expected_h = ( - np . sum ( xlogy ( expected_p , expected_h ) ) ) #NEWLINE# assert_allclose ( h , expected_h ) #NEWLINE# hg = stats . hypergeom ( 1 , 1 , 1 ) #NEWLINE# h = hg . entropy ( ) #NEWLINE# assert_equal ( h , 0.0 )