#NEWLINE# def _repr_matrix( self , matrix ) : #NEWLINE# #INDENT# s = '' #NEWLINE# cellWidth = 11 #NEWLINE# shape = matrix . shape #NEWLINE# for i in range ( shape [ 0 ] ) : #NEWLINE# #INDENT# for j in range ( shape [ 1 ] ) : #NEWLINE# #INDENT# v = matrix [ ( i , j ) ] #NEWLINE# if np . isnan ( v ) : #NEWLINE# #INDENT# s += '---' . center ( cellWidth ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# exp = np . log ( abs ( v ) ) #NEWLINE# if ( abs ( exp ) <= 4 ) : #NEWLINE# #INDENT# if ( exp < 0 ) : #NEWLINE# #INDENT# s += ( '%9.6f' % v ) . ljust ( cellWidth ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# s += ( '%9.*f' % ( 6 , v ) ) . ljust ( cellWidth ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# s += ( '%9.2e' % v ) . ljust ( cellWidth ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# s += '\n' #NEWLINE# #UNINDENT# return s [ : ( - 1 ) ]