Group by with aggregation

PHOTO EMBED

Wed May 05 2021 10:48:30 GMT+0000 (Coordinated Universal Time)

Saved by @ncellepola

from pyspark.sql import functions as F
df.groupBy("gender").agg(F.min("math score"), F.max("math score"), F.avg("math score")).show()
content_copyCOPY

http://localhost:8888/notebooks/Udemy/pyspark/Python+vs+PySpark+[PySpark].ipynb/Python vs PySpark [PySpark].ipynb