Section 1. Chapter 30
single
Challenge: Advanced Aggregation
Swipe to show menu
Task
Swipe to start coding
Practice applying multiple aggregation functions to grouped data in a data frame.
Given a data frame, a grouping column, and a numeric column, compute the mean, sum, and standard deviation of the numeric column for each group.
- Group the data frame by the values in the
group_colcolumn. - For each group, calculate the mean, sum, and standard deviation of the values in the
agg_colcolumn. - Return a data frame with one row per group and columns for the group, mean, sum, and standard deviation.
Solution
Everything was clear?
Thanks for your feedback!
Section 1. Chapter 30
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat