male male female male no no no no sun sun sun sun dinner dinner dinner dinner column-wise and multiple function application as you've seen aboveaggregating series or all of the columns of dataframe is matter of using aggregate with the desired function or calling method like mean or std howeveryou may want to aggregate using different function depending on the column or multiple functions at once fortunatelythis is straightforward to dowhich 'll illustrate through number of examples firsti'll group the tips by sex and smokerin [ ]grouped tips groupby(['sex''smoker']note that for descriptive statistics like those in table - you can pass the name of the function as stringin [ ]grouped_pct grouped['tip_pct'in [ ]grouped_pct agg('mean'out[ ]sex smoker female no yes male no yes nametip_pct if you pass list of functions or function names insteadyou get back dataframe with column names taken from the functionsin [ ]grouped_pct agg(['mean''std'peak_to_peak]out[ ]mean std peak_to_peak sex smoker female no yes male no yes you don' need to accept the names that groupby gives to the columnsnotably lambda functions have the name 'which make them hard to identify (you can see for yourself by looking at function' __name__ attributeas suchif you pass list of (namefunctiontuplesthe first element of each tuple will be used as the dataframe column names (you can think of list of -tuples as an ordered mapping)in [ ]grouped_pct agg([('foo''mean')('bar'np std)]out[ ]foo bar sex smoker female no yes data aggregation and group operations www it-ebooks info