code: def convert_Series_to_Panel(obj, store=None, return_to_mtype=False):
      """Convert series to a single-series panel.
  
      Adds a dummy dimension to the series.
      For pd.Series or DataFrame, this results in a list of DataFram (dim added is list).
      For numpy array, this results in a third dimension being added.
  
      Assumes input is conformant with one of the three Series mtypes.
      This method does not perform full mtype checks, use mtype or check_is_mtype for
      checks.
  
      Parameters
      ----------
      obj: an object of scitype Series, of mtype pd.DataFrame, pd.Series, or np.ndarray.
      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 was pd.Series or pd.DataFrame, returns a panel of mtype df-list
          this is done by possibly converting to pd.DataFrame, and adding a list nesting
      if obj was np.ndarray, returns a panel of mtype numpy3D, by adding one axis at end
      """
      if isinstance(obj, pd.Series):
          obj = pd.DataFrame(obj)
  
      if isinstance(obj, pd.DataFrame):
          if return_to_mtype:
              return [obj], "df-list"
          else:
              return [obj]
  
      if isinstance(obj, np.ndarray):
          if len(obj.shape) == 2:
              # from numpy2D to numpy3D
              # numpy2D = (time, variables)
              # numpy3D = (instances, variables, time)
              obj = np.expand_dims(obj, 0)
              obj = np.swapaxes(obj, 1, 2)
              obj_mtype = "numpy3D"
          elif len(obj.shape) == 1:
              # from numpy1D to numpy3D
              # numpy1D = (time)
              # numpy3D = (instances, variables, time)
              obj = np.expand_dims(obj, (0, 1))
              obj_mtype = "numpy3D"
          else:
              raise ValueError(
                  "if obj is np.ndarray, must be of dim 1 or 2"
              )
  
      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 1 for calling a global function with example usage: convert_Series_to_Panel(obj, store, return_to_mtype) and returns: obj,  obj_mtype, obj, list,  str, list