class_docstr: Special class of TsData, which can be partitioned.
  Derived classes should implement __iter__ and __len__.
docstr: Helper function to turn an iterable of tuples with three entries into a dataframe.
  
  The input ``list_of_tuples`` needs to be an iterable with tuples containing three
  entries: (a, b, c).
  Out of this, a pandas dataframe will be created with all a's as index,
  all b's as columns and all c's as values.
  
  It basically does a pd.pivot(first entry, second entry, third entry),
  but optimized for non-pandas input (= python list of tuples).
  
  This function is called in the end of the extract_features call.
code: def pivot(self, results):
      """
      Helper function to turn an iterable of tuples with three entries into a dataframe.
  
      The input ``list_of_tuples`` needs to be an iterable with tuples containing three
      entries: (a, b, c).
      Out of this, a pandas dataframe will be created with all a's as index,
      all b's as columns and all c's as values.
  
      It basically does a pd.pivot(first entry, second entry, third entry),
      but optimized for non-pandas input (= python list of tuples).
  
      This function is called in the end of the extract_features call.
      """
      return_df_dict = defaultdict(dict)
      for chunk_id, variable, value in results:
          # we turn it into a nested mapping `column -> index -> value`
          return_df_dict[variable][chunk_id] = value
  
      # the mapping column -> {index -> value}
      # is now a dict of dicts. The pandas dataframe
      # constructor will peel this off:
      # first, the keys of the outer dict (the column)
      # will turn into a column header and the rest into a column
      # the rest is {index -> value} which will be turned into a
      # column with index.
      # All index will be aligned.
      return_df = pd.DataFrame(return_df_dict, dtype=float)
  
      # copy the type of the index
      return_df.index = return_df.index.astype(self.df_id_type)
  
      # Sort by index to be backward compatible
      return_df = return_df.sort_index()
  
      return return_df
  
imports: import itertools
  from collections import defaultdict, namedtuple
  from typing import Iterable, Sized
  import pandas
label_desc: Use image node_id 2 for calling the PartitionedTsData obj's underlying member method code with example usage: obj.pivot(results) and returns: return_df