transform one (or more) column(s) into Vector
Now you scan scale the data using StandardScaler
Add everything to a `Pipeline` to make it easier
#transform one column into Vector that is required input data type for Scalers.
from pyspark.ml.feature import StandardScaler
from pyspark.ml.feature import VectorAssembler
vector_assembler = VectorAssembler(inputCols=["avg_price"],
outputCol="avg_price_vector")
data = vector_assembler.transform(data)
# Now you scan scale the data using StandardScaler
standard_scaler = StandardScaler(withMean=True, withStd=True,
inputCol="avg_price_vector",
outputCol="avg_price_scaled")
final_data_prepared = standard_scaler.fit(data).transform(data)