(
        self,
        aggregations: Dict[
            Variable, List[Union[str, Callable, Tuple[str, Union[str, Callable]]]]
        ],
        callback: Callable = dummy_callback,
    )
return agg_table
Compute aggregations for each group

        Parameters
        ----------
        aggregations
            The dictionary that defines aggregations that need to be computed
            for variables. We support two formats:
            - {variable name: [agg function 1, agg function 2]}
            - {variable name: [(agg name 1, agg function 1),  (agg name 1, agg function 1)]}
            Where agg name is the aggregation name used in the output column name.
            Aggregation function can be either function or string that defines
            aggregation in Pandas (e.g. mean).
        callback
            Callback function to report the progress

        Returns
        -------
        Table that includes aggregation columns. Variables that are used for
        grouping are in metas.
Compute aggregations for each group
Compute aggregations for each group
def aggregate(
        self,
        aggregations: Dict[
            Variable, List[Union[str, Callable, Tuple[str, Union[str, Callable]]]]
        ],
        callback: Callable = dummy_callback,
    ) -> Table:
        """
        Compute aggregations for each group

        Parameters
        ----------
        aggregations
            The dictionary that defines aggregations that need to be computed
            for variables. We support two formats:
            - {variable name: [agg function 1, agg function 2]}
            - {variable name: [(agg name 1, agg function 1),  (agg name 1, agg function 1)]}
            Where agg name is the aggregation name used in the output column name.
            Aggregation function can be either function or string that defines
            aggregation in Pandas (e.g. mean).
        callback
            Callback function to report the progress

        Returns
        -------
        Table that includes aggregation columns. Variables that are used for
        grouping are in metas.
        """
        num_aggs = sum(len(aggs) for aggs in aggregations.values())
        count = 0

        result_agg = []
        for col, aggs in aggregations.items():
            for agg in aggs:
                res = self._compute_aggregation(col, agg)
                result_agg.append(res)
                count += 1
                callback(count / num_aggs * 0.8)

        agg_table = self._aggregations_to_table(result_agg)
        callback(1)
        return agg_table
def aggregate ( self , aggregations : Dict [ Variable , List [ Union [ str , Callable , Tuple [ str , Union [ str , Callable ] ] ] ] ] , callback : Callable = dummy_callback , ) -> Table : num_aggs = sum ( len ( aggs ) for aggs in aggregations . values ( ) ) count = 0 result_agg = [ ] for col , aggs in aggregations . items ( ) : for agg in aggs : res = self . _compute_aggregation ( col , agg ) result_agg . append ( res ) count += 1 callback ( count / num_aggs * 0.8 ) agg_table = self . _aggregations_to_table ( result_agg ) callback ( 1 ) return agg_table