title: TypeError: 'float' object cannot be interpreted as an index
body: <p>I am facing an issue which was not occurring before, maybe some rules have been changed. </p>
  
  <pre><code>    Traceback (most recent call last)
      &lt;ipython-input-3-f47687e192a7&gt; in &lt;module&gt;()
            5 n_examples = X.shape[0]
            6 n_train = n_examples * 0.5
      ----&gt; 7 train_idx = np.random.choice(range(0,n_examples), size=n_train, replace=False)
            8 test_idx = list(set(range(0,n_examples))-set(train_idx))
            9 X_train = X[train_idx]
  
      mtrand.pyx in mtrand.RandomState.choice (numpy/random/mtrand/mtrand.c:18822)()
  
      TypeError: 'float' object cannot be interpreted as an index
  </code></pre>