code: def to_sktime_dataset(X):
      """Transform a tslearn-compatible dataset into a sktime dataset.
  
      Parameters
      ----------
      X: array, shape = (n_ts, sz, d)
          tslearn-formatted dataset to be cast to sktime format
  
      Returns
      -------
      Pandas data-frame
          sktime-formatted dataset (cf.
          `link <https://alan-turing-institute.github.io/sktime/examples/loading_data.html>`_)
  
      Examples
      --------
      >>> tslearn_arr = numpy.random.randn(10, 16, 1)
      >>> sktime_arr = to_sktime_dataset(tslearn_arr)
      >>> sktime_arr.shape
      (10, 1)
      >>> sktime_arr["dim_0"][0].shape
      (16,)
      >>> tslearn_arr = numpy.random.randn(10, 16, 2)
      >>> sktime_arr = to_sktime_dataset(tslearn_arr)
      >>> sktime_arr.shape
      (10, 2)
      >>> sktime_arr["dim_1"][0].shape
      (16,)
  
      Notes
      -----
      Conversion from/to sktime format requires pandas to be installed.
      """  # noqa: E501
      try:
          import pandas as pd
      except ImportError:
          raise ImportError(
              "Conversion from/to sktime cannot be performed "
              "if pandas is not installed."
          )
      X_ = check_dataset(X)
      X_pd = pd.DataFrame(dtype=float)
      for dim in range(X_.shape[2]):
          X_pd["dim_" + str(dim)] = [
              pd.Series(data=Xi[: ts_size(Xi), dim]) for Xi in X_
          ]
      return X_pd
  
file_path: tslearn/tslearn/utils/cast.py
imports: import warnings
  import numpy
  from sklearn.utils import check_array
  from .utils import check_dataset, ts_size, to_time_series_dataset
label_desc: Use image node_id 8 for calling a global function with example usage: to_sktime_dataset(X) and returns: X_pd