December 2018
Beginner to intermediate
682 pages
18h 1m
English
If you do not use an aggregating function with agg, pandas raises an exception. For instance, let's see what happens when we apply the square root function to each group:
>>> flights.groupby('AIRLINE')['ARR_DELAY'].agg(np.sqrt)ValueError: function does not reduce