title: cifar10 randomize train and test set
body: <p>I would like to randomize the 60000 observations of the CIFAR-10 dataset present in the <em>keras.datasets</em> library. I know that it may not be so relevant in order to construct a neural network, but I'm a Python novice and I would like to learn data handling with this programming language.</p>
  
  <p>So, to import the dataset, I run</p>
  
  <pre><code>from keras.datasets import cifar10
  (X_train, Y_train), (X_test, Y_test) = cifar10.load_data()
  </code></pre>
  
  <p>which automatically gives me a default subdivision of the train and test set; but I would like to mix them. 
  The steps I have in mind are:</p>
  
  <ul>
  <li>concatenate the train and test sets in a dataset <em>X</em> of shape (60000, 32, 32, 3) and a dataset <em>Y</em> of shape (60000, 1)</li>
  <li>generate some random indeces to subset the <em>X</em> and <em>Y</em> dataset in, say, a training set of 50000 obs and a test set of 10000 obs</li>
  <li>create new datasets (in a <em>ndarray</em> format) <em>X_train</em>, <em>X_test</em>, <em>Y_train</em>, <em>Y_test</em> with the same shapes as the original ones, so that I can start training my convolutional neural network</li>
  </ul>
  
  <p>but maybe there's even a quicker approach to this.</p>
  
  <p>I have tried different methods for a couple of hours but I didn't manage to achieve anything. Can somebody help me? I would really appreciate it, thanks.</p>