How the parenthesis caught me off guard

I had to see the answer for https://app.dataquest.io/m/343/data-aggregation/9/introduction-to-the-agg-method and it turns out that mean_max_dif = happy_grouped.agg([dif]) returns a Dataframe because of the parenthesis while with no parenthesis mean_max_dif = happy_grouped.agg(dif) you get a Series.

6 Likes