ignore = ['id', 'label', 'binomial_label']
assembler = VectorAssembler(inputCols=[x for x in df.columns if x not in
    ignore], outputCol='features')
assembler.transform(df)
Create feature vector programmatically in Spark ML / pyspark