df = sc.parallelize([row('0', 3.0, DenseVector([0, 2.1, 1.0])), row('1', 
    1.0, DenseVector([0, 1.1, 1.0])), row('1', -1.0, DenseVector([0, 3.4, 
    0.0])), row('0', -3.0, DenseVector([0, 4.1, 0.0]))]).toDF()
Encode and assemble multiple features in PySpark