def value_counts(n):
    """
    Wrapper for pandas value_counts for use in groupby
    
    Parameters
    ----------
    n: int
        Number of most common responses
        
    Returns
    -------
    function
        value_counts function that can be used in a groupby
        
    Examples
    --------
    >>> DataFrame.groupby('MEASURE_NAME').agg({'VALUE':['size',value_counts(20)]})
        
    """
    def _value_counts(x):
        return list(x.value_counts().index[0:n])
    _value_counts.__name__='Top {} most common responses'.format(n)
    return _value_counts