I have the following code:
from pyspark.sql import functions as func
cols = ("id","size")
result = df.groupby(*cols).agg({
    func.max("val1"),
    func.median("val2"),
    func.std("val2")
})
But it fails in the line func.median("val2") with the message that median cannot be found in func. The same happens to std.
 
    