#NEWLINE# def test_entropy_base( self ) : #NEWLINE# #INDENT# pk = np . ones ( 16 , float ) #NEWLINE# S = stats . entropy ( pk , base = 2.0 ) #NEWLINE# assert_ ( ( abs ( ( S - 4.0 ) ) < 1e-05 ) ) #NEWLINE# qk = np . ones ( 16 , float ) #NEWLINE# qk [ : 8 ] = 2.0 #NEWLINE# S = stats . entropy ( pk , qk ) #NEWLINE# S2 = stats . entropy ( pk , qk , base = 2.0 ) #NEWLINE# assert_ ( ( abs ( ( ( S / S2 ) - np . log ( 2.0 ) ) ) < 1e-05 ) )