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: Get the levels to group by for iteration using iterate_as.
  
  Parameters
  ----------
  iterate_as: The scitype of iteration elements
  
  Returns
  -------
  A list of multiindex levels to group by for iteration
docstr_tok: ["Get","the","levels","to","group","by","for","iteration","using","iterate_as",".","Parameters","--","--","--","--","--","iterate_as",":","The","scitype","of","iteration","elements","Returns","--","--","--","-","A","list","of","multiindex","levels","to","group","by","for","iteration"]
code: def _iter_levels(self, iterate_as):
      """Get the levels to group by for iteration using iterate_as.
  
      Parameters
      ----------
      iterate_as: The scitype of iteration elements
  
      Returns
      -------
      A list of multiindex levels to group by for iteration
      """
      iter_levels = 0
      if self.is_scitype == "Panel":
          if iterate_as == "Series":
              iter_levels = 1
      if self.is_scitype == "Hierarchical":
          if iterate_as == "Panel":
              iter_levels = 2
          elif iterate_as == "Series":
              iter_levels = 1
      return list(range(self.X_mi_index.nlevels - iter_levels))
  
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 13 for calling the VectorizedDF obj's underlying member method code with example usage: obj._iter_levels(iterate_as) and returns: list