class_docstr: K-fold iterator variant for temporal splitting of time series data
  
  The time series' are divided in time with no overlap, and are balanced.
  
  By splitting the time series', the number of samples in the data set is changed and so new
  arrays for the data and target are returned by the ``split`` function in addition to the
  iterator.
  
  Parameters
  ----------
  n_splits : int > 1
      number of folds
  
  Examples
  --------
  >>> from seglearn.split import TemporalKFold
  >>> from seglearn.datasets import load_watch
  >>> data = load_watch()
  >>> splitter = TemporalKFold(n_splits=4)
  >>> X, y, cv = splitter.split(data['X'], data['y'])
class_docstr_tok: ["K-fold","iterator","variant","for","temporal","splitting","of","time","series","data","The","time","series","'","are","divided","in","time","with","no","overlap",",","and","are","balanced",".","By","splitting","the","time","series","'",",","the","number","of","samples","in","the","data","set","is","changed","and","so","new","arrays","for","the","data","and","target","are","returned","by","the","``","split","``","function","in","addition","to","the","iterator",".","Parameters","--","--","--","--","--","n_splits",":","int",">","1","number","of","folds","Examples","--","--","--","--",">",">",">","from","seglearn.split","import","TemporalKFold",">",">",">","from","seglearn.datasets","import","load_watch",">",">",">","data","=","load_watch","(",")",">",">",">","splitter","=","TemporalKFold","(","n_splits=4",")",">",">",">","X",",","y",",","cv","=","splitter.split","(","data","[","'","X","'","]",",","data","[","'","y","'","]",")"]
docstr: takes time series data, and splits each series into temporal folds 
docstr_tok: ["takes","time","series","data",",","and","splits","each","series","into","temporal","folds"]
code: def _ts_slice(self, Xt, y):
      """takes time series data, and splits each series into temporal folds"""
      Ns = len(Xt)
      Xt_new = []
      for i in range(self.n_splits):
          for j in range(Ns):
              Njs = int(len(Xt[j]) / self.n_splits)
              Xt_new.append(Xt[j][(Njs * i) : (Njs * (i + 1))])
      Xt_new = np.array(Xt_new)
  
      if len(np.atleast_1d(y[0])) == len(Xt[0]):
          # y is a time series
          y_new = []
          for i in range(self.n_splits):
              for j in range(Ns):
                  Njs = int(len(y[j]) / self.n_splits)
                  y_new.append(y[j][(Njs * i) : (Njs * (i + 1))])
          y_new = np.array(y_new)
      else:
          # y is contextual to each series
          y_new = np.concatenate([y for i in range(self.n_splits)])
  
      return Xt_new, y_new
  
file_path: seglearn/seglearn/split.py
imports: import numpy
  from sklearn.model_selection._split import _build_repr
  from .util import check_ts_data, get_ts_data_parts
  from .base import TS_Data
label_desc: Use image node_id 4 for calling the TemporalKFold obj's underlying member method code with example usage: obj._ts_slice(Xt, y) and returns: Xt_new,  y_new