class_docstr: Turns time series/panel data into tabular data based on intervals.
  
  This estimator converts nested pandas dataframe containing
  time-series/panel data with numpy arrays or pandas Series in
  dataframe cells into a tabular pandas dataframe with only primitives in
  cells. The primitives are calculated based on Intervals defined
  by the IntervalIndex and aggregated by aggfunc.
  
  This is useful for transforming time-series/panel data
  into a format that is accepted by standard validation learning
  algorithms (as in sklearn).
  
  Parameters
  ----------
  idx : pd.IntervalIndex
      IntervalIndex defining intervals considered by aggfunc
  aggfunc : callable
      Function used to aggregate the values in intervals.
      Should have signature 1D -> float and defaults
      to mean if None
class_docstr_tok: ["Turns","time","series\/panel","data","into","tabular","data","based","on","intervals",".","This","estimator","converts","nested","pandas","dataframe","containing","time-series\/panel","data","with","numpy","arrays","or","pandas","Series","in","dataframe","cells","into","a","tabular","pandas","dataframe","with","only","primitives","in","cells",".","The","primitives","are","calculated","based","on","Intervals","defined","by","the","IntervalIndex","and","aggregated","by","aggfunc",".","This","is","useful","for","transforming","time-series\/panel","data","into","a","format","that","is","accepted","by","standard","validation","learning","algorithms","(","as","in","sklearn",")",".","Parameters","--","--","--","--","--","idx",":","pd.IntervalIndex","IntervalIndex","defining","intervals","considered","by","aggfunc","aggfunc",":","callable","Function","used","to","aggregate","the","values","in","intervals",".","Should","have","signature","1D","-",">","float","and","defaults","to","mean","if","None"]
code: def __init__(self, idx, aggfunc=None):
      assert isinstance(
          idx, pd.IntervalIndex
      ), "idx should be of type pd.IntervalIndex"
      self.aggfunc = aggfunc
      if self.aggfunc is None:
          self._aggfunc = np.mean
          warnings.warn(
              "No aggfunc was passed, defaulting to mean",
              stacklevel=2,
          )
      else:
          assert callable(aggfunc), (
              "aggfunc should be callable with" "signature 1D -> float"
          )
          if aggfunc.__name__ == "<lambda>":
              warnings.warn(
                  "Save and load will not work with lambda functions",
                  stacklevel=2,
              )
          self._aggfunc = self.aggfunc
      self.idx = idx
  
      super().__init__()
  
file_path: sktime/sktime/transformations/panel/reduce.py
imports: import warnings
  import numpy
  import pandas
  from sktime.datatypes import convert, convert_to
  from sktime.transformations.base import BaseTransformer
  from sktime.utils.pandas import df_map
label_desc: Use image node_id 1 to create a new TimeBinner object from inherited base classes: BaseTransformer with example: obj = TimeBinner(idx, aggfunc)