Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Aggregate on the entire DataFrame without group

# Aggregate on the entire DataFrame without group

df.agg({"age": "max"}).collect()
# [Row(max(age)=5)]
from pyspark.sql import functions as F
df.agg(F.min(df.age)).collect()
# [Row(min(age)=2)]
Source by spark.apache.org #
 
PREVIOUS NEXT
Tagged: #Aggregate #entire #DataFrame #group
ADD COMMENT
Topic
Name
2+3 =