class_docstr: Wrapper for easy vectorization/iteration over instances.
  
  VectorizedDF is an iterable that returns pandas.DataFrame
      in sktime Series or Panel format.
  Elements are all Series or Panels in X, these are iterated over.
  
  Parameters
  ----------
  X : object in sktime compatible Panel or Hierarchical format
      the data container to vectorize over
  y : placeholder argument, not used currently
  is_scitype : str ("Panel", "Hierarchical") or None, default = "Panel"
      scitype of X, if known; if None, will be inferred
      provide to constructor if known to avoid superfluous checks
          Caution: will not conduct checks if provided, assumes checks done
  iterate_as : str ("Series", "Panel"), optional, default="Series
      scitype of the iteration
      for instance, if X is Panel and iterate_as is "Series"
          then the class will iterate over individual Series in X
      or, if X is Hierarchical and iterate_as is "Panel"
          then the class will iterate over individual Panels in X
              (Panel = flat/non-hierarchical collection of Series)
  iterate_cols : boolean, optional, default=False
      whether to iterate over columns, if true, the class will iterate over columns
  
  Methods
  -------
  iter(self) or self.__iter__()
      Iterates over each Series/Panel (depending on iterate_as) in X
      as pandas.DataFrame with Index or MultiIndex (in sktime pandas format)
  len(self) or self.__len__()
      returns number of Series/Panels in X
  get_iter_indices()
      Returns pandas.(Multi)Index that are iterated over
  reconstruct(self, df_list, convert_back=False)
      Takes iterable df_list and returns as an object of is_scitype.
      Used to obtain original format after applying operations to self iterated
class_docstr_tok: ["Wrapper","for","easy","vectorization\/iteration","over","instances",".","VectorizedDF","is","an","iterable","that","returns","pandas.DataFrame","in","sktime","Series","or","Panel","format",".","Elements","are","all","Series","or","Panels","in","X",",","these","are","iterated","over",".","Parameters","--","--","--","--","--","X",":","object","in","sktime","compatible","Panel","or","Hierarchical","format","the","data","container","to","vectorize","over","y",":","placeholder","argument",",","not","used","currently","is_scitype",":","str","(","``","Panel","''",",","``","Hierarchical","''",")","or","None",",","default","=","``","Panel","''","scitype","of","X",",","if","known",";","if","None",",","will","be","inferred","provide","to","constructor","if","known","to","avoid","superfluous","checks","Caution",":","will","not","conduct","checks","if","provided",",","assumes","checks","done","iterate_as",":","str","(","``","Series","''",",","``","Panel","''",")",",","optional",",","default=","''","Series","scitype","of","the","iteration","for","instance",",","if","X","is","Panel","and","iterate_as","is","``","Series","''","then","the","class","will","iterate","over","individual","Series","in","X","or",",","if","X","is","Hierarchical","and","iterate_as","is","``","Panel","''","then","the","class","will","iterate","over","individual","Panels","in","X","(","Panel","=","flat\/non-hierarchical","collection","of","Series",")","iterate_cols",":","boolean",",","optional",",","default=False","whether","to","iterate","over","columns",",","if","true",",","the","class","will","iterate","over","columns","Methods","--","--","--","-","iter","(","self",")","or","self.__iter__","(",")","Iterates","over","each","Series\/Panel","(","depending","on","iterate_as",")","in","X","as","pandas.DataFrame","with","Index","or","MultiIndex","(","in","sktime","pandas","format",")","len","(","self",")","or","self.__len__","(",")","returns","number","of","Series\/Panels","in","X","get_iter_indices","(",")","Returns","pandas",".","(","Multi",")","Index","that","are","iterated","over","reconstruct","(","self",",","df_list",",","convert_back=False",")","Takes","iterable","df_list","and","returns","as","an","object","of","is_scitype",".","Used","to","obtain","original","format","after","applying","operations","to","self","iterated"]
docstr: Reconstruct original format from iterable of vectorization instances.
  
  Parameters
  ----------
  df_list : iterable of objects of same type and sequence as __iter__ returns.
      can be self, but will in general be another object to be useful.
      Example: [some_operation(df) for df in self] that leaves types the same
  convert_back : bool, optional, default = False
      whether to convert output back to mtype of X in __init__
      if False, the return will be a pandas.DataFrame with Index or multiIndex
      if True, the return is converted to the mtype of X in __init__
  overwrite_index : bool, optional, default = True
      if True, the resulting return will have index overwritten by that of X
          only if applies, i.e., overwrite is possible and X had an index
      if False, no index overwrite will happen
  col_multiindex : str, one of "none", "flat", "multiindex", default = "none"
      whether column multiindex is introduced, and if yes, what kind of,
      in case of column vectorization being applied
      "none" - df_list are simply concatenated, unless:
          If at least one var is transformed to two or more, "flat" is enforced.
          If this would cause non-unique column names, "flat" is enforced.
      "multiindex" - additional level is introduced, by names of X passed to init,
          if there would be more than one column underneath at least one level
          this is added as an additional pandas MultiIndex level
      "flat" - additional level is introduced, by names of X passed to init
          if there would be more than one column underneath at least one level
          like "multiindex", but new level is flattened to "var__colname" strings
          no new multiindex level is introduced
  
  Returns
  -------
  X_reconstructed_orig_format : row-concatenation of df-list,
      with keys and additional level from self.get_iter_indices
      if convert_back=False, always a pd.DataFrame in an sktime MultiIndex format
          (pd-muliindex mtype for Panel, or pd_multiindex_hier for Hierarchical)
      if convert_back=True, will have same format and mtype as X input to __init__
docstr_tok: ["Reconstruct","original","format","from","iterable","of","vectorization","instances",".","Parameters","--","--","--","--","--","df_list",":","iterable","of","objects","of","same","type","and","sequence","as","__iter__","returns",".","can","be","self",",","but","will","in","general","be","another","object","to","be","useful",".","Example",":","[","some_operation","(","df",")","for","df","in","self","]","that","leaves","types","the","same","convert_back",":","bool",",","optional",",","default","=","False","whether","to","convert","output","back","to","mtype","of","X","in","__init__","if","False",",","the","return","will","be","a","pandas.DataFrame","with","Index","or","multiIndex","if","True",",","the","return","is","converted","to","the","mtype","of","X","in","__init__","overwrite_index",":","bool",",","optional",",","default","=","True","if","True",",","the","resulting","return","will","have","index","overwritten","by","that","of","X","only","if","applies",",","i.e.",",","overwrite","is","possible","and","X","had","an","index","if","False",",","no","index","overwrite","will","happen","col_multiindex",":","str",",","one","of","``","none","''",",","``","flat","''",",","``","multiindex","''",",","default","=","``","none","''","whether","column","multiindex","is","introduced",",","and","if","yes",",","what","kind","of",",","in","case","of","column","vectorization","being","applied","``","none","''","-","df_list","are","simply","concatenated",",","unless",":","If","at","least","one","var","is","transformed","to","two","or","more",",","``","flat","''","is","enforced",".","If","this","would","cause","non-unique","column","names",",","``","flat","''","is","enforced",".","``","multiindex","''","-","additional","level","is","introduced",",","by","names","of","X","passed","to","init",",","if","there","would","be","more","than","one","column","underneath","at","least","one","level","this","is","added","as","an","additional","pandas","MultiIndex","level","``","flat","''","-","additional","level","is","introduced",",","by","names","of","X","passed","to","init","if","there","would","be","more","than","one","column","underneath","at","least","one","level","like","``","multiindex","''",",","but","new","level","is","flattened","to","``","var__colname","''","strings","no","new","multiindex","level","is","introduced","Returns","--","--","--","-","X_reconstructed_orig_format",":","row-concatenation","of","df-list",",","with","keys","and","additional","level","from","self.get_iter_indices","if","convert_back=False",",","always","a","pd.DataFrame","in","an","sktime","MultiIndex","format","(","pd-muliindex","mtype","for","Panel",",","or","pd_multiindex_hier","for","Hierarchical",")","if","convert_back=True",",","will","have","same","format","and","mtype","as","X","input","to","__init__"]
code: def reconstruct(
      self,
      df_list,
      convert_back=False,
      overwrite_index=True,
      col_multiindex="none",
  ):
      """Reconstruct original format from iterable of vectorization instances.
  
      Parameters
      ----------
      df_list : iterable of objects of same type and sequence as __iter__ returns.
          can be self, but will in general be another object to be useful.
          Example: [some_operation(df) for df in self] that leaves types the same
      convert_back : bool, optional, default = False
          whether to convert output back to mtype of X in __init__
          if False, the return will be a pandas.DataFrame with Index or multiIndex
          if True, the return is converted to the mtype of X in __init__
      overwrite_index : bool, optional, default = True
          if True, the resulting return will have index overwritten by that of X
              only if applies, i.e., overwrite is possible and X had an index
          if False, no index overwrite will happen
      col_multiindex : str, one of "none", "flat", "multiindex", default = "none"
          whether column multiindex is introduced, and if yes, what kind of,
          in case of column vectorization being applied
          "none" - df_list are simply concatenated, unless:
              If at least one var is transformed to two or more, "flat" is enforced.
              If this would cause non-unique column names, "flat" is enforced.
          "multiindex" - additional level is introduced, by names of X passed to init,
              if there would be more than one column underneath at least one level
              this is added as an additional pandas MultiIndex level
          "flat" - additional level is introduced, by names of X passed to init
              if there would be more than one column underneath at least one level
              like "multiindex", but new level is flattened to "var__colname" strings
              no new multiindex level is introduced
  
      Returns
      -------
      X_reconstructed_orig_format : row-concatenation of df-list,
          with keys and additional level from self.get_iter_indices
          if convert_back=False, always a pd.DataFrame in an sktime MultiIndex format
              (pd-muliindex mtype for Panel, or pd_multiindex_hier for Hierarchical)
          if convert_back=True, will have same format and mtype as X input to __init__
      """
  
      def coerce_to_df(x):
          if not isinstance(x, pd.DataFrame):
              return self._coerce_to_df(x)
          else:
              return x
  
      df_list = [coerce_to_df(x) for x in df_list]
  
      # condition where "flat" behaviour is enforced if "none":
      def _force_flat(df_list):
          # transformer produces at least one multivariate output
          # and there is more than one data frame to concatenate columns of
          force_flat = len(df_list) > 1 and any(
              len(x.columns) > 1 for x in df_list
          )
          # or, there would be duplicate columns, after the transformation
          all_col_idx = [ix for df in df_list for ix in df.columns]
          force_flat = force_flat or len(set(all_col_idx)) != len(
              all_col_idx
          )
          return force_flat
  
      row_ix, col_ix = self.get_iter_indices()
      force_flat = False
      if row_ix is None and col_ix is None:
          X_mi_reconstructed = pd.DataFrame(df_list[0])
      elif col_ix is None:
          X_mi_reconstructed = pd.concat(df_list, keys=row_ix, axis=0)
      elif row_ix is None:
          force_flat = _force_flat(df_list)
          if col_multiindex in ["flat", "multiindex"] or force_flat:
              col_keys = col_ix
          else:
              col_keys = None
          X_mi_reconstructed = pd.concat(df_list, axis=1, keys=col_keys)
      else:  # both col_ix and row_ix are not None
          col_concats = []
          row_n = len(row_ix)
          col_n = len(col_ix)
          for i in range(row_n):
              ith_col_block = df_list[i * col_n : (i + 1) * col_n]
              force_flat = force_flat or _force_flat(ith_col_block)
              if col_multiindex in ["flat", "multiindex"] or force_flat:
                  col_keys = col_ix
              else:
                  col_keys = None
              col_concats += [
                  pd.concat(ith_col_block, axis=1, keys=col_keys)
              ]
  
          X_mi_reconstructed = pd.concat(
              col_concats, keys=row_ix, axis=0
          )
  
      X_mi_index = X_mi_reconstructed.index
      X_orig_row_index = self.X_mi_index
  
      flatten = col_multiindex == "flat" or (
          col_multiindex == "none" and force_flat
      )
      if flatten and isinstance(
          X_mi_reconstructed.columns, pd.MultiIndex
      ):
          X_mi_reconstructed.columns = flatten_multiindex(
              X_mi_reconstructed.columns
          )
  
      if overwrite_index and len(X_mi_index.names) == len(
          X_orig_row_index.names
      ):
          X_mi_reconstructed.index = X_mi_index.set_names(
              X_orig_row_index.names
          )
  
      if not convert_back:
          return X_mi_reconstructed
      else:
          X_orig_mtype = self.X_orig_mtype
          is_scitype = self.is_scitype
          if X_orig_mtype is None:
              X_orig_mtype = mtype(self.X, as_scitype=self.is_scitype)
  
          X_reconstructed_orig_format = convert_to(
              X_mi_reconstructed,
              to_type=X_orig_mtype,
              as_scitype=is_scitype,
              store=self.converter_store,
          )
  
          return X_reconstructed_orig_format
  
imports: import itertools
  import numpy
  import pandas
  from sktime.datatypes._check import check_is_scitype, mtype
  from sktime.datatypes._convert import convert_to
  from sktime.utils.multiindex import flatten_multiindex
  from sktime.utils.parallel import parallelize
label_desc: Use image node_id 16 for calling the VectorizedDF obj's underlying member method code with example usage: obj.reconstruct(df_list, convert_back, overwrite_index, col_multiindex) and returns: force_flat, X_mi_reconstructed, X_reconstructed_orig_format, self, x