Pyspark Group y promedio en Dataframes
df.groupBy("Profession").agg({'Age':'avg', 'Gender':'count'}).show()
Fine Falcon
df.groupBy("Profession").agg({'Age':'avg', 'Gender':'count'}).show()
from pyspark.sql import functions as F
df.groupBy("Profession").agg(F.mean('Age'), F.count('Age')).show()