daft.DataFrame.agg

Contents

daft.DataFrame.agg#

DataFrame.agg(to_agg: List[Tuple[Union[Expression, str], str]]) DataFrame[source]#

Perform aggregations on this DataFrame. Allows for mixed aggregations for multiple columns Will return a single row that aggregated the entire DataFrame.

Example

>>> df = df.agg([
>>>     ('x', 'sum'),
>>>     ('x', 'mean'),
>>>     ('y', 'min'),
>>>     ('y', 'max'),
>>>     (col('x') + col('y'), 'max'),
>>> ])
Parameters:

to_agg (List[Tuple[ColumnInputType, str]]) – list of (column, agg_type)

Returns:

DataFrame with aggregated results

Return type:

DataFrame