title: Most orthodox way of splitting matrix and list in Python
body: <p>If I have ratios to split a dataset into training, validation, and test sets, what is the most orthodox and elegant way of doing this in Python?</p>
  
  <p>For instance, I split my data into 60% training, 20% testing, and 20% validation.  I have 1000 rows of data with 10 features each, and a label vector of size 1000.  The training set matrix should be of size (600, 10), and so on.</p>
  
  <p>If I create new matrices of features and lists of labels, it wouldn't be memory efficient right? Lets say I did something like this:</p>
  
  <pre><code>TRAIN_PORTION = int(datasetSize * tr)
  VALIDATION_PORTION = int(datasetSize * va)
  
  # Whatever is left will be for testing
  TEST_PORTION = datasetSize - TRAIN_PORTION - VALIDATION_PORTION
  trainingSet = dataSet[0, TRAIN_PORTION:]
  validationSet = dataSet[TRAIN_PORTION,
                     TRAIN_PORTION + VALIDATIONPORTION:]
  testSet = dataset[TRAIN_PORTION+VALIATION_PORTION, datasetSize:]
  </code></pre>
  
  <p>That would leave me with the double amount of used memory, right?</p>
  
  <p>Sorry for the incorrect Python syntax, and thank you for any help.</p>