#NEWLINE# @ cache_readonly #NEWLINE# def cumulative_log_oddsratios( self ) : #NEWLINE# #INDENT# ta = self . table . cumsum ( 0 ) . cumsum ( 1 ) #NEWLINE# a = ta [ 0 : ( - 1 ) , 0 : ( - 1 ) ] #NEWLINE# b = ( ta [ 0 : ( - 1 ) , ( - 1 ) : ] - a ) #NEWLINE# c = ( ta [ ( - 1 ) : , 0 : ( - 1 ) ] - a ) #NEWLINE# d = ( ta [ ( ( - 1 ) , ( - 1 ) ) ] - ( ( a + b ) + c ) ) #NEWLINE# tab = ( ( ( np . log ( a ) + np . log ( d ) ) - np . log ( b ) ) - np . log ( c ) ) #NEWLINE# rslt = np . empty ( self . table . shape , np . float64 ) #NEWLINE# rslt *= np . nan #NEWLINE# rslt [ 0 : ( - 1 ) , 0 : ( - 1 ) ] = tab #NEWLINE# if isinstance ( self . table_orig , pd . DataFrame ) : #NEWLINE# #INDENT# rslt = pd . DataFrame ( rslt , index = self . table_orig . index , columns = self . table_orig . columns ) #NEWLINE# #UNINDENT# return rslt