title: Using df.withColumn() on multiple columns
body: <p>I am working with python and pyspark to extend the SPSS Modeler.</p>
  
  <p>I want to manipulate ~5000 columns and therefore use the following construct:</p>
  
  <pre><code>for target in targets:
      inputData = inputData.withColumn(target+appendString, function(target))
  </code></pre>
  
  <p>This is very slow. Is there a more efficent way to do this for all target columns?</p>
  
  <p><code>targets</code> contains a list of column names to be used, <code>function(target)</code> is a placeholder where I do stuff with different columns like adding and dividing.</p>
  
  <p>I would be happy if you could help me :)</p>
  
  <p>pandayo</p>