object for exampleas you recall quantile computes sample quantiles of series or dataframe' columns in [ ]df out[ ]data - - - data key key one two one two one in [ ]grouped df groupby('key 'in [ ]grouped['data 'quantile( out[ ]key - while quantile is not explicitly implemented for groupbyit is series method and thus available for use internallygroupby efficiently slices up the seriescalls piece quantile( for each piecethen assembles those results together into the result object to use your own aggregation functionspass any function that aggregates an array to the aggregate or agg methodin [ ]def peak_to_peak(arr)return arr max(arr min(in [ ]grouped agg(peak_to_peakout[ ]data data key you'll notice that some methods like describe also workeven though they are not aggregationsstrictly speakingin [ ]grouped describe(out[ ]data data key count mean std min - note that quantile performs linear interpolation if there is no value at exactly the passed percentile data aggregation and group operations www it-ebooks info