#NEWLINE# def __init__( self , data , precision = None , table_styles = None , uuid = None , caption = None , table_attributes = None ) : #NEWLINE# #INDENT# self . ctx = defaultdict ( list ) #NEWLINE# self . _todo = [ ] #NEWLINE# if ( not isinstance ( data , ( pd . Series , pd . DataFrame ) ) ) : #NEWLINE# #INDENT# raise TypeError #NEWLINE# #UNINDENT# if ( data . ndim == 1 ) : #NEWLINE# #INDENT# data = data . to_frame ( ) #NEWLINE# #UNINDENT# if ( ( not data . index . is_unique ) or ( not data . columns . is_unique ) ) : #NEWLINE# #INDENT# raise ValueError ( 'style is not supported for non-unique indicies.' ) #NEWLINE# #UNINDENT# self . data = table_styles #NEWLINE# self . index = data . index #NEWLINE# self . columns = data . columns #NEWLINE# self . uuid = uuid #NEWLINE# self . table_styles = table_styles #NEWLINE# self . caption = caption #NEWLINE# if ( precision is None ) : #NEWLINE# #INDENT# precision = pd . options . display . precision #NEWLINE# #UNINDENT# self . precision = precision #NEWLINE# self . table_attributes = table_attributes #NEWLINE# def default_display_func( x ) : #NEWLINE# #INDENT# if com . is_float ( x ) : #NEWLINE# #INDENT# return '{:>.{precision}g}' . format ( x , precision = self . precision ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return x #NEWLINE# #UNINDENT# #UNINDENT# self . _display_funcs = defaultdict ( ( lambda : default_display_func ) )