class_docstr: Initialize a Dataset from a CSV file/dataframe. This does NOT
  actually load the data into memory if the ``csv`` parameter contains filepaths.
  
  :param csv: (string or pandas.DataFrame):
      if string, should be a path to a .csv file which
      can be loaded as a pandas dataframe
  
  :param input_cols: (list of ints, or list of strings):
      which column(s) to use as input arrays.
      If int(s), should be column indicies.
      If str(s), should be column names
  
  :param target_cols: (list of ints, or list of strings):
      which column(s) to use as input arrays.
      If int(s), should be column indicies.
      If str(s), should be column names
  
  :param input_transform: (transform):
      tranform to apply to inputs during runtime loading
  
  :param target_tranform: (transform):
      transform to apply to targets during runtime loading
  
  :param co_transform: (transform):
      transform to apply to both inputs and targets simultaneously
      during runtime loading
  
  :param apply_transforms_individually: (bool):
      Whether to apply transforms to individual inputs or to an input row as a whole (default: False)
docstr: Define a split for the current dataset where some part of it is used for
  training while the remainder is used for testing
  
  :param train_size: (int): length of the training dataset. The remainder will be
      returned as the test dataset
  :return: tuple of datasets (train, test)
docstr_tok: ["Define","a","split","for","the","current","dataset","where","some","part","of","it","is","used","for","training","while","the","remainder","is","used","for","testing",":","param","train_size",":","(","int",")",":","length","of","the","training","dataset",".","The","remainder","will","be","returned","as","the","test","dataset",":","return",":","tuple","of","datasets","(","train",",","test",")"]
code: def train_test_split(self, train_size):
      """
      Define a split for the current dataset where some part of it is used for
      training while the remainder is used for testing
  
      :param train_size: (int): length of the training dataset. The remainder will be
          returned as the test dataset
      :return: tuple of datasets (train, test)
      """
      if train_size < 1:
          train_size = int(train_size * len(self))
  
      train_indices = np.random.choice(
          len(self), train_size, replace=False
      )
      test_indices = np.array(
          [i for i in range(len(self)) if i not in train_indices]
      )
  
      train_df = self.df.iloc[train_indices, :]
      test_df = self.df.iloc[test_indices, :]
  
      train_dataset = self.copy(train_df)
      test_dataset = self.copy(test_df)
  
      return train_dataset, test_dataset
  
file_path: pywick/pywick/datasets/CSVDataset.py
imports: from .BaseDataset import BaseDataset
  import numpy
  import pandas
  from .data_utils import _return_first_element_of_list, default_file_reader, _pass_through, _process_transform_argument, _process_co_transform_argument
label_desc: Use image node_id 4 for calling the CSVDataset obj's underlying member method code with example usage: obj.train_test_split(train_size) and returns: train_dataset,  test_dataset