#NEWLINE# def test_kurt( self ) : #NEWLINE# #INDENT# tm . _skip_if_no_scipy ( ) #NEWLINE# from scipy.stats import kurtosis #NEWLINE# alt = ( lambda x : kurtosis ( x , bias = False ) ) #NEWLINE# self . _check_stat_op ( 'kurt' , alt ) #NEWLINE# index = MultiIndex ( levels = [ [ 'bar' ] , [ 'one' , 'two' , 'three' ] , [ 0 , 1 ] ] , labels = [ [ 0 , 0 , 0 , 0 , 0 , 0 ] , [ 0 , 1 , 2 , 0 , 1 , 2 ] , [ 0 , 1 , 0 , 1 , 0 , 1 ] ] ) #NEWLINE# s = Series ( np . random . randn ( 6 ) , index = index ) #NEWLINE# self . assertAlmostEqual ( s . kurt ( ) , s . kurt ( level = 0 ) [ 'bar' ] ) #NEWLINE# min_N = 4 #NEWLINE# for i in range ( 1 , ( min_N + 1 ) ) : #NEWLINE# #INDENT# s = Series ( np . ones ( i ) ) #NEWLINE# df = DataFrame ( np . ones ( ( i , i ) ) ) #NEWLINE# if ( i < min_N ) : #NEWLINE# #INDENT# self . assertTrue ( np . isnan ( s . kurt ( ) ) ) #NEWLINE# self . assertTrue ( np . isnan ( df . kurt ( ) ) . all ( ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . assertEqual ( 0 , s . kurt ( ) ) #NEWLINE# self . assertTrue ( ( df . kurt ( ) == 0 ) . all ( ) )