title: How to select multiple non-contigous columns from a list into another dataframe in python
body: <p>I am working on <code>Ipython</code> and <code>Spark</code> and I have a <code>RDD</code> from which I form a <code>list</code>. Now from this <code>list</code> I want to form a <code>dataframe</code> which has multiple columns from parent <code>list</code> but these columns are not contiguous. I wrote this but it seems to be working wrong:</p>
  
  <pre><code>list1 = rdd.collect()
  columns_num = [1,8,11,17,21,24]
  df2 = [list[i] for i in columns_num]
  </code></pre>
  
  <p>The above code only selects 6 rows, with only column 1 data, from parent <code>list</code> and forms the new <code>dataframe</code> with those 6 columns 1 data.</p>
  
  <p>How can I form a new <code>dataframe</code> with multiple not contiguous columns from another <code>list</code></p>