class_docstr: Format a time series dataframe or list of dataframes into the a format that matches the structure learned by
      `from_pandas_dynamic`. This is done to allow for bayesian network probability fitting.
  
      Example of utilisation:
      >>> ddt = DynamicDataTransformer(p=p).fit(time_series, return_df=False)
      >>> X, Xlags = ddt.transform(time_series)
  
      >>> ddt = DynamicDataTransformer(p=p).fit(time_series, return_df=True)
      >>> df = ddt.transform(time_series)
docstr: Helper function for `from_pandas_dynamic`
  Receive a list of dataframes. For each dataframe, cut the points of discontinuity as two different dataframes.
  Discontinuities are determined by the indexes.
  
  For Example:
  If the following is a dataframe:
      index   variable_1  variable_2
      1       X           X
      2       X           X
      3       X           X
      4       X           X
      8       X           X               <- discontinuity point
      9       X           X
      10      X           X
  
  We cut this dataset in two:
  
      index   variable_1  variable_2
      1       X           X
      2       X           X
      3       X           X
      4       X           X
  
      and:
      index   variable_1  variable_2
      8       X           X
      9       X           X
      10      X           X
  
  
  Args:
      time_series: list of dataframes representing various realisations of a same time series
  
  Returns:
      List of np.ndarrays representing the pieces of the input datasets with no discontinuity
docstr_tok: ["Helper","function","for","`","from_pandas_dynamic","`","Receive","a","list","of","dataframes",".","For","each","dataframe",",","cut","the","points","of","discontinuity","as","two","different","dataframes",".","Discontinuities","are","determined","by","the","indexes",".","For","Example",":","If","the","following","is","a","dataframe",":","index","variable_1","variable_2","1","X","X","2","X","X","3","X","X","4","X","X","8","X","X","<","-","discontinuity","point","9","X","X","10","X","X","We","cut","this","dataset","in","two",":","index","variable_1","variable_2","1","X","X","2","X","X","3","X","X","4","X","X","and",":","index","variable_1","variable_2","8","X","X","9","X","X","10","X","X","Args",":","time_series",":","list","of","dataframes","representing","various","realisations","of","a","same","time","series","Returns",":","List","of","np.ndarrays","representing","the","pieces","of","the","input","datasets","with","no","discontinuity"]
code: def _cut_dataframes_on_discontinuity_points(
      time_series: List[pd.DataFrame],
  ) -> List[np.ndarray]:
      """
      Helper function for `from_pandas_dynamic`
      Receive a list of dataframes. For each dataframe, cut the points of discontinuity as two different dataframes.
      Discontinuities are determined by the indexes.
  
      For Example:
      If the following is a dataframe:
          index   variable_1  variable_2
          1       X           X
          2       X           X
          3       X           X
          4       X           X
          8       X           X               <- discontinuity point
          9       X           X
          10      X           X
  
      We cut this dataset in two:
  
          index   variable_1  variable_2
          1       X           X
          2       X           X
          3       X           X
          4       X           X
  
          and:
          index   variable_1  variable_2
          8       X           X
          9       X           X
          10      X           X
  
  
      Args:
          time_series: list of dataframes representing various realisations of a same time series
  
      Returns:
          List of np.ndarrays representing the pieces of the input datasets with no discontinuity
  
      """
      time_series_realisations = []
      for t in time_series:
          cutting_points = np.where(np.diff(t.index) > 1)[0]
          cutting_points = [0] + list(cutting_points + 1) + [len(t)]
          for start, end in zip(
              cutting_points[:-1], cutting_points[1:]
          ):
              time_series_realisations.append(
                  t.iloc[start:end, :].values
              )
      return time_series_realisations
  
file_path: causalnex/causalnex/structure/transformers.py
imports: from copy import deepcopy
  from typing import List, Tuple, Union
  import numpy
  import pandas
  from sklearn.base import BaseEstimator, TransformerMixin
  from sklearn.exceptions import NotFittedError
label_desc: Use image node_id 6 for calling the DynamicDataTransformer obj's underlying member method code with example usage: obj._cut_dataframes_on_discontinuity_points(time_series) and returns: time_series_realisations