title: Partition train / test data with np.random.rand
body: <p>I am trying to understand this line of code:</p>
  <pre><code>msk = np.random.rand(len(df)) &lt; 0.8
  </code></pre>
  <p>From my understanding, <code>numpy.random.rand(len(df))</code> returns an array of numbers between [0, 1), generated from the uniform distribution.</p>
  <p>What does each number represent in the array? Are the values percentiles of the data?</p>
  <p>After doing that, we get array of boolean objects, then create train, test sets.</p>
  <pre><code>train = cdf[msk]
  test = cdf[~msk]
  </code></pre>
  <p>In this code, for each column in <code>cdf</code> is it matching each boolean object in an array <code>msk</code> and if it is <code>True</code>, it takes that row and put it into <code>train</code>? and if <code>False</code> into <code>test</code> set?</p>
  <p>I want to know if my understanding is correct</p>