Answers for "Aggregate on the entire DataFrame without group"

0

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)]
Posted by: Guest on April-20-2020

Code answers related to "Aggregate on the entire DataFrame without group"

Python Answers by Framework

Browse Popular Code Answers by Language