title: sklearn.cross_validation raises IndexError: arrays used as indices must be of integer (or boolean) type
body: <p>I was struggling with <code>IndexError</code> raised from <code>sklearn.cross_validation</code>. I solved this and seems the bug of <code>sklearn</code>.</p>
  
  <p>I run the following code on ipython parallel engine:</p>
  
  <pre><code>kf = cross_validation.KFold(num_data, k_fold)
  for k, (train, test) in enumerate(kf):
      # do something
  </code></pre>
  
  <p>and happend error</p>
  
  <pre><code>IndexError: arrays used as indices must be of integer (or boolean) type
  </code></pre>
  
  <p>the place error occuring is:</p>
  
  <pre><code>def _iter_test_masks(self):
      """Generates boolean masks corresponding to test sets.
  
      By default, delegates to _iter_test_indices()
      """
      for test_index in self._iter_test_indices():
          test_mask = self._empty_mask()
          test_mask[test_index] = True # &lt;============= Here error occurs
          yield test_mask
  </code></pre>
  
  <p>How to solve this?</p>