title: changing data type in rdd
body: <p>I have an rdd</p>
  
  <pre><code>rdd=sc.parallelize([[True,False,False], [True,True,True], [False,False,True]])
  </code></pre>
  
  <p>I want to change the rows to integers. If I only had three elements in each row I could use</p>
  
  <pre><code>def asInt(x):
      return [int(x[0]), int(x[1]), int(x[2])]
  
  
  rdd=rdd.map(asInt)
  </code></pre>
  
  <p>which gives me </p>
  
  <pre><code>[[1, 0, 0], [1, 1, 1], [0, 0, 1]]
  </code></pre>
  
  <p>but I have millions of rows, so I need a different solution. I would also accept any solution that uses a DataFrame.</p>