class_docstr: This class defines a simple aggregator that operates on groups of entries 
  in a pandas dataframe
  
  `func` should accept a dataframe and return a list of dataframes with appropriate indices
class_docstr_tok: ["This","class","defines","a","simple","aggregator","that","operates","on","groups","of","entries","in","a","pandas","dataframe","`","func","`","should","accept","a","dataframe","and","return","a","list","of","dataframes","with","appropriate","indices"]
docstr: :param group_by: level at which original metric was computed,
      e.g. ('subject_id', 'label')
  :param func: function (dataframe=>dataframe) to aggregate the collected
               metrics
docstr_tok: [":","param","group_by",":","level","at","which","original","metric","was","computed",",","e.g",".","(","'subject_id","'",",","'label","'",")",":","param","func",":","function","(","dataframe=",">","dataframe",")","to","aggregate","the","collected","metrics"]
code: def __init__(self, group_by, func):
      """
      :param group_by: level at which original metric was computed,
          e.g. ('subject_id', 'label')
      :param func: function (dataframe=>dataframe) to aggregate the collected
                   metrics
      """
      self.group_by = group_by
      self.func = func
  
imports: from __future__ import absolute_import, division, print_function
  import itertools
  from itertools import groupby
  from collections import defaultdict
  import pandas
  from niftynet.engine.application_factory import EvaluationFactory
  from niftynet.utilities.util_common import cache
label_desc: Use image node_id 1 to create a new DataFrameAggregator object from inherited base classes: object with example: obj = DataFrameAggregator(group_by, func)