title: What is the correct way to use pyspark VectorAssembler?
body: <p>I am trying to combine all feature columns into a single one</p>
  
  <p>So:</p>
  
  <pre><code>assembler = VectorAssembler(
      inputCols=feature_list,
      outputCol='features')
  </code></pre>
  
  <p>In which:</p>
  
  <p><code>feature_list</code> is a Python list that contains all the feature column names</p>
  
  <p>Then</p>
  
  <p><code>trainingData = assembler.transform(df)</code></p>
  
  <p>But when I did:</p>
  
  <p><a href="https://i.stack.imgur.com/NoiPK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NoiPK.png" alt="enter image description here"></a></p>
  
  <p>What is the correct way to use VectorAssembler?</p>
  
  <p>Many thanks</p>