'Aggregate each group in the Table into a single row by applying the reduction
function ``func`` to group values in each column.
Parameters
func : function
Function that reduces an array of values to a single value
Returns
out : Table
New table with the aggregated rows.'

def aggregate(self, func):

    (i0s, i1s) = (self.indices[:(-1)], self.indices[1:])
    out_cols = []
    parent_table = self.parent_table
    for col in six.itervalues(parent_table.columns):
        if (col.info.name in self.key_colnames):
            new_col = col.take(i0s)
        else:
            try:
                new_col = col.groups.aggregate(func)
            except TypeError as err:
                warnings.warn(six.text_type(err), AstropyUserWarning)
                continue
        out_cols.append(new_col)
    return parent_table.__class__(out_cols, meta=parent_table.meta)
