#NEWLINE# def write_result( self , buf ) : #NEWLINE# #INDENT# indent = 0 #NEWLINE# frame = self . frame #NEWLINE# _classes = [ 'dataframe' ] #NEWLINE# if ( self . classes is not None ) : #NEWLINE# #INDENT# if isinstance ( self . classes , str ) : #NEWLINE# #INDENT# self . classes = self . classes . split ( ) #NEWLINE# #UNINDENT# if ( not isinstance ( self . classes , ( list , tuple ) ) ) : #NEWLINE# #INDENT# raise AssertionError ( ( 'classes must be list or tuple, not %s' % type ( self . classes ) ) ) #NEWLINE# #UNINDENT# _classes . extend ( self . classes ) #NEWLINE# #UNINDENT# if self . notebook : #NEWLINE# #INDENT# div_style = '' #NEWLINE# try : #NEWLINE# #INDENT# import IPython #NEWLINE# if ( IPython . __version__ < LooseVersion ( '3.0.0' ) ) : #NEWLINE# #INDENT# div_style = ' style="max-width:1500px;overflow:auto;"' #NEWLINE# #UNINDENT# #UNINDENT# except ImportError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# self . write ( '<div{0}>' . format ( div_style ) ) #NEWLINE# #UNINDENT# self . write ( ( '<table border="1" class="%s">' % ' ' . join ( _classes ) ) , indent ) #NEWLINE# indent += self . indent_delta #NEWLINE# indent = self . _write_header ( indent ) #NEWLINE# indent = self . _write_body ( indent ) #NEWLINE# self . write ( '</table>' , indent ) #NEWLINE# if self . should_show_dimensions : #NEWLINE# #INDENT# by = ( chr ( 215 ) if compat . PY3 else unichr ( 215 ) ) #NEWLINE# self . write ( ( u ( '<p>%d rows %s %d columns</p>' ) % ( len ( frame ) , by , len ( frame . columns ) ) ) ) #NEWLINE# #UNINDENT# if self . notebook : #NEWLINE# #INDENT# self . write ( '</div>' ) #NEWLINE# #UNINDENT# _put_lines ( buf , self . elements )