me({'A': 'a a b'.split(), 'B': [1,2,3], 'C': [4,6, 5]})
    >>> g = df.groupby('A')

    From ``df`` above we can see that ``g`` has two groups, ``a``, ``b``.
    Calling ``apply`` in various ways, we can get different grouping results:

    Example 1: below the function passed to ``apply`` takes a dataframe as
    its argument and returns a dataframe. ``apply`` combines the result for
    each group together into a new dataframe:

    >>> g.apply(lambda x: x / x.sum())
              B    C
    0  0.333333  0.4
    1  0.666667  0.6
    2  1.000000  1.0

    Example 2: The function passed to ``apply`` takes a dataframe as
    its argument and returns a series.  ``apply`` combines the result for
    each group together into a new dataframe:

    >>> g.apply(lambda x: x.max() - x.min())
       B  C
    A
    a  1  2
    b  0  0

    Example 3: The function passed to ``apply`` takes a dataframe as
    its argument and returns a scalar. ``apply`` combines the result for
    each group together into a series, including setting the index as
    appropriate:

    >>> g.apply(lambda x: x.C.max() - x.B.min())
    A
    a    5
    b    2
    dtype: int64
    aa