def __init_grouping(self, result_col, cols):
   aggcol = None
   if not result_col is None:
     # Setup new column name
     aggcol = utils.to_safe(self.name, len(self.labels))
     self.labels[aggcol] = [result_col]
     self.reverse_labels[result_col] = aggcol
   # Find real column names
   realcols = []
   for col in cols:
     try:
       realcols.append(self.reverse_labels[col])
     except KeyError:
       raise InvalidInstructionException("Couldn't find column \"" + col + "\"")
   return aggcol, realcols
 def __init_grouping(self, result_col, cols):
     aggcol = None
     if not result_col is None:
         # Setup new column name
         aggcol = utils.to_safe(self.name, len(self.labels))
         self.labels[aggcol] = [result_col]
         self.reverse_labels[result_col] = aggcol
     # Find real column names
     realcols = []
     for col in cols:
         try:
             realcols.append(self.reverse_labels[col])
         except KeyError:
             raise InvalidInstructionException("Couldn't find column \"" +
                                               col + "\"")
     return aggcol, realcols
 def __setup_names(self):
   """Rebuilds all column names to put them into the form __<tablename>_<idx>"""
   for idx,col in enumerate(self.dataframe.columns):
     new_name = utils.to_safe(self.name, idx)
     self.rename(col, new_name)
 def __setup_names(self):
     """Rebuilds all column names to put them into the form __<tablename>_<idx>"""
     for idx, col in enumerate(self.dataframe.columns):
         new_name = utils.to_safe(self.name, idx)
         self.rename(col, new_name)