I have used 'agg' and get average value of a column in my data frame, like this
df.groupBy('day','city')
.agg(count("*"),
avg(df.price).alias("avgPrice")
)
From here Calculate percentile on pyspark dataframe columns, it said I can use df.selectExpr('percentile(MOU_G_EDUCATION_ADULT, 0.95)')
to get 95 percentile of a column.
So how can I add the that to inside the agg() function?