# Grouping data by a column and calculating aggregate functions
grouped_df = df.groupBy('column').agg({'column2': 'sum', 'column3': 'avg'})
# Applying aggregate functions to entire DataFrame
agg_df = df.agg({'column1': 'max', 'column2': 'min'})
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter