class_docstr: Concatenate multivariate series to a long univariate series.
  
  Transformer that concatenates multivariate time series/panel data
  into single univariate time series/panel data by concatenating
  each individual series on top of each other from left to right.
  
  Uses pandas method stack() to do the concatenating
  
  Examples
  --------
  >>> from sktime.transformations.panel.compose import ColumnConcatenator # noqa: E501
  >>> import numpy as np
  >>> data = np.array([[1, 2, 3],
  ...                  [4, 5, 6],
  ...                  [7, 8, 9]])
  >>> concatenator = ColumnConcatenator()
  >>> concatenator.fit_transform(data)
  array([[1.],
         [4.],
         [7.],
         [2.],
         [5.],
         [8.],
         [3.],
         [6.],
         [9.]])
  
  Another example with panel data.
  
  >>> from sktime.utils._testing.panel import _make_panel
  >>> panel_data = _make_panel(n_columns = 2,
  ...                          n_instances = 2,
  ...                          n_timepoints = 3)
  >>> panel_data = concatenator.fit_transform(panel_data)
class_docstr_tok: ["Concatenate","multivariate","series","to","a","long","univariate","series",".","Transformer","that","concatenates","multivariate","time","series\/panel","data","into","single","univariate","time","series\/panel","data","by","concatenating","each","individual","series","on","top","of","each","other","from","left","to","right",".","Uses","pandas","method","stack","(",")","to","do","the","concatenating","Examples","--","--","--","--",">",">",">","from","sktime.transformations.panel.compose","import","ColumnConcatenator","#","noqa",":","E501",">",">",">","import","numpy","as","np",">",">",">","data","=","np.array","(","[","[","1",",","2",",","3","]",",","...","[","4",",","5",",","6","]",",","...","[","7",",","8",",","9","]","]",")",">",">",">","concatenator","=","ColumnConcatenator","(",")",">",">",">","concatenator.fit_transform","(","data",")","array","(","[","[","1",".","]",",","[","4",".","]",",","[","7",".","]",",","[","2",".","]",",","[","5",".","]",",","[","8",".","]",",","[","3",".","]",",","[","6",".","]",",","[","9",".","]","]",")","Another","example","with","panel","data",".",">",">",">","from","sktime.utils._testing.panel","import","_make_panel",">",">",">","panel_data","=","_make_panel","(","n_columns","=","2",",","...","n_instances","=","2",",","...","n_timepoints","=","3",")",">",">",">","panel_data","=","concatenator.fit_transform","(","panel_data",")"]
docstr: Transform the data.
  
  Concatenate multivariate time series/panel data into long
  univariate time series/panel
  data by simply concatenating times series in time.
  
  Parameters
  ----------
  X : nested pandas DataFrame of shape [n_samples, n_features]
      Nested dataframe with time-series in cells.
  
  Returns
  -------
  Xt : pandas DataFrame
    Transformed pandas DataFrame with same number of rows and single
    column
docstr_tok: ["Transform","the","data",".","Concatenate","multivariate","time","series\/panel","data","into","long","univariate","time","series\/panel","data","by","simply","concatenating","times","series","in","time",".","Parameters","--","--","--","--","--","X",":","nested","pandas","DataFrame","of","shape","[","n_samples",",","n_features","]","Nested","dataframe","with","time-series","in","cells",".","Returns","--","--","--","-","Xt",":","pandas","DataFrame","Transformed","pandas","DataFrame","with","same","number","of","rows","and","single","column"]
code: def _transform(self, X, y=None):
      """Transform the data.
  
      Concatenate multivariate time series/panel data into long
      univariate time series/panel
      data by simply concatenating times series in time.
  
      Parameters
      ----------
      X : nested pandas DataFrame of shape [n_samples, n_features]
          Nested dataframe with time-series in cells.
  
      Returns
      -------
      Xt : pandas DataFrame
        Transformed pandas DataFrame with same number of rows and single
        column
      """
      Xst = pd.DataFrame(X.stack())
      Xt = Xst.swaplevel(-2, -1).sort_index().droplevel(-2)
  
      # the above has the right structure, but the wrong index
      # the time index is in general non-unique now, we replace it by integer index
      inst_idx = Xt.index.get_level_values(0)
      t_idx = [range(len(Xt.loc[x])) for x in inst_idx.unique()]
      t_idx = np.concatenate(t_idx)
  
      Xt.index = pd.MultiIndex.from_arrays([inst_idx, t_idx])
      Xt.index.names = X.index.names
      return Xt
  
imports: from warnings import warn
  import numpy
  import pandas
  from sklearn.compose import ColumnTransformer
  from sktime.transformations.base import BaseTransformer, _PanelToPanelTransformer
  from sktime.utils.multiindex import flatten_multiindex
  from sktime.utils.validation.panel import check_X
label_desc: Use image node_id 1 for calling the ColumnConcatenator obj's underlying member method code with example usage: obj._transform(X, y) and returns: Xt