In the Data Aggregator series, lesson 9 of 14, the instructions ask you to pass a function into the groupby.agg() method, then assign the result to mean_max_dif
.
The solution broke my brain a little bit because the answer is groupby.agg([function]) and no arguments.
here is the line: mean_max_dif = happy_grouped.agg(dif)
The function is called dif. How is it possible that this code works without passing an argument into the function? How does the code no what to act on without looking like this instead:
mean_max_dif = happy_grouped.agg(dif([Insert Group Here]))
The function header is def dif(group), so isn’t an argument required?