### Filling with mean values with an imputerfrom pyspark.ml.feature import Imputer
### Create an imputer objectimputer = Imputer(
inputCols= ["total_bill", "tip"],
outputCols = ["{}_imputed".format(c) for c in ["total_bill", "tip"]]
).setStrategy("mean")
### Fit imputer on Data Frame and Transform itimputer.fit(df_pyspark).transform(df_pyspark).show()