class_docstr: Object that compiles statistics on a list of arbitrary objects.
  When created the statistics object receives a *key* argument that
  is used to get the values on which the function will be computed.
  If not provided the *key* argument defaults to the identity function.
  
  The value returned by the key may be a multi-dimensional object, i.e.:
  a tuple or a list, as long as the statistical function registered
  support it. So for example, statistics can be computed directly on
  multi-objective fitnesses when using numpy statistical function.
  
  :param key: A function to access the values on which to compute the
              statistics, optional.
  
  ::
  
      >>> import numpy
      >>> s = Statistics()
      >>> s.register("mean", numpy.mean)
      >>> s.register("max", max)
      >>> s.compile([1, 2, 3, 4])     # doctest: +SKIP
      {'max': 4, 'mean': 2.5}
      >>> s.compile([5, 6, 7, 8])     # doctest: +SKIP
      {'mean': 6.5, 'max': 8}
class_docstr_tok: ["Object","that","compiles","statistics","on","a","list","of","arbitrary","objects",".","When","created","the","statistics","object","receives","a","*","key","*","argument","that","is","used","to","get","the","values","on","which","the","function","will","be","computed",".","If","not","provided","the","*","key","*","argument","defaults","to","the","identity","function",".","The","value","returned","by","the","key","may","be","a","multi-dimensional","object",",","i.e",".",":","a","tuple","or","a","list",",","as","long","as","the","statistical","function","registered","support","it",".","So","for","example",",","statistics","can","be","computed","directly","on","multi-objective","fitnesses","when","using","numpy","statistical","function",".",":","param","key",":","A","function","to","access","the","values","on","which","to","compute","the","statistics",",","optional",".",":",":",">",">",">","import","numpy",">",">",">","s","=","Statistics","(",")",">",">",">","s.register","(","``","mean","''",",","numpy.mean",")",">",">",">","s.register","(","``","max","''",",","max",")",">",">",">","s.compile","(","[","1",",","2",",","3",",","4","]",")","#","doctest",":","+SKIP","{","'max","'",":","4",",","'mean","'",":","2.5","}",">",">",">","s.compile","(","[","5",",","6",",","7",",","8","]",")","#","doctest",":","+SKIP","{","'mean","'",":","6.5",",","'max","'",":","8","}"]
code: def __init__(self, key=identity):
      self.key = key
      self.functions = dict()
      self.fields = []
  
imports: from bisect import bisect_right
  from collections import defaultdict
  from copy import deepcopy
  from functools import partial
  from itertools import chain
  from operator import eq
label_desc: Use image node_id 1 to create a new Statistics object from inherited base classes: object with example: obj = Statistics(key)