class_docstr: Evolution records as a chronological list of dictionaries.
  
  Data can be retrieved via the :meth:`select` method given the appropriate
  names.
  
  The :class:`Logbook` class may also contain other logbooks referred to
  as chapters. Chapters are used to store information associated to a
  specific part of the evolution. For example when computing statistics
  on different components of individuals (namely :class:`MultiStatistics`),
  chapters can be used to distinguish the average fitness and the average
  size.
class_docstr_tok: ["Evolution","records","as","a","chronological","list","of","dictionaries",".","Data","can","be","retrieved","via","the",":","meth",":","`","select","`","method","given","the","appropriate","names",".","The",":","class",":","`","Logbook","`","class","may","also","contain","other","logbooks","referred","to","as","chapters",".","Chapters","are","used","to","store","information","associated","to","a","specific","part","of","the","evolution",".","For","example","when","computing","statistics","on","different","components","of","individuals","(","namely",":","class",":","`","MultiStatistics","`",")",",","chapters","can","be","used","to","distinguish","the","average","fitness","and","the","average","size","."]
code: def __init__(self):
      self.buffindex = 0
      self.chapters = defaultdict(Logbook)
      """Dictionary containing the sub-sections of the logbook which are also
          :class:`Logbook`. Chapters are automatically created when the right hand
          side of a keyworded argument, provided to the *record* function, is a
          dictionary. The keyword determines the chapter's name. For example, the
          following line adds a new chapter "size" that will contain the fields
          "max" and "mean". ::
  
              logbook.record(gen=0, size={'max' : 10.0, 'mean' : 7.5})
  
          To access a specific chapter, use the name of the chapter as a
          dictionary key. For example, to access the size chapter and select
          the mean use ::
  
              logbook.chapters["size"].select("mean")
  
          Compiling a :class:`MultiStatistics` object returns a dictionary
          containing dictionaries, therefore when recording such an object in a
          logbook using the keyword argument unpacking operator (**), chapters
          will be automatically added to the logbook.
          ::
  
              >>> fit_stats = Statistics(key=attrgetter("fitness.values"))
              >>> size_stats = Statistics(key=len)
              >>> mstats = MultiStatistics(fitness=fit_stats, size=size_stats)
              >>> # [...]
              >>> record = mstats.compile(population)
              >>> logbook.record(**record)
              >>> print logbook
                fitness          length
              ------------    ------------
              max     mean    max     mean
              2       1       4       3
  
          """
  
      self.columns_len = None
      self.header = None
      """Order of the columns to print when using the :data:`stream` and
          :meth:`__str__` methods. The syntax is a single iterable containing
          string elements. For example, with the previously
          defined statistics class, one can print the generation and the
          fitness average, and maximum with
          ::
  
              logbook.header = ("gen", "mean", "max")
  
          If not set the header is built with all fields, in arbitrary order
          on insertion of the first data. The header can be removed by setting
          it to :data:`None`.
          """
  
      self.log_header = True
      """Tells the log book to output or not the header when streaming the
          first line or getting its entire string representation. This defaults
          :data:`True`.
          """
  
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 Logbook object from inherited base classes: list with example: obj = Logbook()