code: def from_pyflux_dataset(X):
      """Transform a pyflux-compatible dataset into a tslearn dataset.
  
      Parameters
      ----------
      X: pandas data-frame
          pyflux-formatted dataset
  
      Returns
      -------
      array, shape=(n_ts, sz, d), where n_ts=1
          tslearn-formatted dataset.
          Column order is kept the same as in the original data frame.
  
      Examples
      --------
      >>> import pandas as pd
      >>> pyflux_df = pd.DataFrame()
      >>> pyflux_df["dim_0"] = numpy.random.rand(10)
      >>> tslearn_arr = from_pyflux_dataset(pyflux_df)
      >>> tslearn_arr.shape
      (1, 10, 1)
      >>> pyflux_df = pd.DataFrame()
      >>> pyflux_df["dim_0"] = numpy.random.rand(10)
      >>> pyflux_df["dim_1"] = numpy.random.rand(10)
      >>> pyflux_df["dim_2"] = numpy.random.rand(10)
      >>> tslearn_arr = from_pyflux_dataset(pyflux_df)
      >>> tslearn_arr.shape
      (1, 10, 3)
      >>> pyflux_arr = numpy.random.randn(10, 1, 16)
      >>> from_pyflux_dataset(
      ...     pyflux_arr
      ... )  # doctest: +IGNORE_EXCEPTION_DETAIL
      Traceback (most recent call last):
      ...
      ValueError: X is not a valid input pyflux array.
  
      Notes
      -----
      Conversion from/to pyflux format requires pandas to be installed.
      """
      try:
          import pandas as pd
      except ImportError:
          raise ImportError(
              "Conversion from/to pyflux cannot be performed "
              "if pandas is not installed."
          )
      if not isinstance(X, pd.DataFrame):
          raise ValueError(
              "X is not a valid input pyflux array. "
              "A pandas DataFrame is expected."
          )
      data_dimensions = [col_name for col_name in X.columns]
      d = len(data_dimensions)
      n = 1
  
      max_sz = -1
      for dim_name in data_dimensions:
          if X[dim_name].size > max_sz:
              max_sz = X[dim_name].size
  
      tslearn_arr = numpy.empty((n, max_sz, d))
      tslearn_arr[:] = numpy.nan
      for di, dim_name in enumerate(data_dimensions):
          data = X[dim_name].values.copy()
          sz = len(data)
          tslearn_arr[0, :sz, di] = data
      return tslearn_arr
  
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 11 for calling a global function with example usage: from_pyflux_dataset(X) and returns: tslearn_arr