code: def convert_Panel_to_Series(obj, store=None, return_to_mtype=False):
      """Convert single-series panel to a series.
  
      Removes panel index from the single-series panel to obtain a series.
  
      Assumes input is conformant with one of three main panel mtypes.
      This method does not perform full mtype checks, use mtype or check_is_mtype for
      checks.
  
      Parameters
      ----------
      obj: an object of scitype Panel, of mtype pd-multiindex, numpy3d, or df-list.
      store: dict, optional
          converter store for back-conversion
      return_to_mtype: bool, optional (default=False)
          if True, also returns the str of the mtype converted to
  
      Returns
      -------
      if obj df-list or pd-multiindex, returns a series of type pd.DataFrame
      if obj was numpy3D, returns a panel mtype np.ndarray
      """
      if isinstance(obj, list):
          if len(obj) == 1:
              if return_to_mtype:
                  return obj[0], "pd.DataFrame"
              else:
                  return obj[0]
          else:
              raise ValueError("obj must be of length 1")
  
      if isinstance(obj, pd.DataFrame):
          obj.index = obj.index.droplevel(level=0)
          obj_mtype = "pd.DataFrame"
  
      if isinstance(obj, np.ndarray):
          if obj.ndim != 3 or obj.shape[0] != 1:
              raise ValueError(
                  "if obj is np.ndarray, must be of dim 3, with shape[0]=1"
              )
          # from numpy3D to numpy2D
          # numpy2D = (time, variables)
          # numpy3D = (instances, variables, time)
          obj = np.reshape(obj, (obj.shape[1], obj.shape[2]))
          obj = np.swapaxes(obj, 0, 1)
          obj_mtype = "np.ndarray"
  
      if return_to_mtype:
          return obj, obj_mtype
      else:
          return obj
  
file_path: sktime/sktime/datatypes/_series_as_panel/_convert.py
imports: import numpy
  import pandas
  from sktime.datatypes import convert_to, scitype
label_desc: Use image node_id 2 for calling a global function with example usage: convert_Panel_to_Series(obj, store, return_to_mtype) and returns: obj,  obj_mtype, obj, obj,  str, obj