Answers for "group by summarise in pyspark"

0

pyspark groupby sum

from pyspark.sql import functions as func
prova_df.groupBy("order_item_order_id").agg(func.sum("order_item_subtotal")).show()
Posted by: Guest on February-26-2020
0

pyspark group by and average in dataframes

df.groupBy("Profession").agg({'Age':'avg', 'Gender':'count'}).show()
Posted by: Guest on December-01-2020

Python Answers by Framework

Browse Popular Code Answers by Language