#NEWLINE# def load_df_true_segment( self , df ) : #NEWLINE# #INDENT# '\n        For segmented data.\n        Load true target values (ground truth) into a dataframe attribute from an in-memory dataframe object.\n        ' #NEWLINE# if ( type ( df ) != pd . core . frame . DataFrame ) : #NEWLINE# #INDENT# raise Exception ( ( 'Object passed, %s, is not a Dataframe. Object passed is of type %s' % ( df , type ( df ) ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . id not in df . columns ) : #NEWLINE# #INDENT# raise Exception ( ( 'Dataframe passed, %s, does not contain unique ID field: %s' % ( x , self . id ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( not all ( ( ( x in df . columns ) for x in self . targets ) ) ) : #NEWLINE# #INDENT# raise Exception ( ( 'Dataframe passed, %s, does not contain all target variables: %s' % ( df , self . targets ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . df_true_segment = df . copy ( ) #NEWLINE# utils . info ( 'True value for target variables successfully loaded into self.df_true_segment' )