Skip to content

Instantly share code, notes, and snippets.

@MovileGente
Created April 16, 2019 19:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MovileGente/fd35a6cad1176a3a3367a84c90212431 to your computer and use it in GitHub Desktop.
Save MovileGente/fd35a6cad1176a3a3367a84c90212431 to your computer and use it in GitHub Desktop.
from pyspark.sql import functions as F
dataset_agrupado = dataset.groupBy("Series") \
.agg(F.avg("X").alias("X_agrupado"), F.avg("Y").alias("Y_agrupado")) \
.orderBy("Series")
dataset_agrupado.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment