ibis.expr.api.TableExpr.group_by

TableExpr.group_by(by=None, **additional_grouping_expressions)

Create an intermediate grouped table expression, pending some group operation to be applied with it.

Returns:
grouped_expr : GroupedTableExpr

Notes

group_by and groupby are equivalent, with groupby being provided for ease-of-use for pandas users.

Examples

>>> import ibis
>>> pairs = [('a', 'int32'), ('b', 'timestamp'), ('c', 'double')]
>>> t = ibis.table(pairs)
>>> b1, b2 = t.a, t.b
>>> result = t.group_by([b1, b2]).aggregate(sum_of_c=t.c.sum())