title: Pyspark: using filter for feature selection
body: <p>I have an array of dimensions 500 x 26. Using the filter operation in pyspark,  I'd like to pick out the columns which are listed in another array at row i. Ex: if<br>
      <code>a[i]= [1 2 3]</code></p>
  
  <p>Then pick out columns 1, 2 and 3 and all rows. Can this be done with filter command?  If yes, can someone show an example or the syntax? </p>