MCPcopy
hub / github.com/ray-project/ray / _aggregate_on

Method _aggregate_on

python/ray/data/grouped_data.py:75–92  ·  view source on GitHub ↗

Helper for aggregating on a particular subset of the dataset. This validates the `on` argument, and converts a list of column names to a multi-aggregation. A null `on` results in a multi-aggregation on all columns for an Arrow Dataset, and a single aggregation on the

(
        self,
        agg_cls: type,
        on: Union[str, List[str]],
        *args,
        **kwargs,
    )

Source from the content-addressed store, hash-verified

73 return Dataset._from_parent(self._dataset, logical_plan)
74
75 def _aggregate_on(
76 self,
77 agg_cls: type,
78 on: Union[str, List[str]],
79 *args,
80 **kwargs,
81 ):
82 """Helper for aggregating on a particular subset of the dataset.
83
84 This validates the `on` argument, and converts a list of column names
85 to a multi-aggregation. A null `on` results in a
86 multi-aggregation on all columns for an Arrow Dataset, and a single
87 aggregation on the entire row for a simple Dataset.
88 """
89 aggs = self._dataset._build_multicolumn_aggs(
90 agg_cls, on, *args, skip_cols=self._key, **kwargs
91 )
92 return self.aggregate(*aggs)
93
94 @PublicAPI(api_group=FA_API_GROUP)
95 def map_groups(

Callers 5

sumMethod · 0.95
minMethod · 0.95
maxMethod · 0.95
meanMethod · 0.95
stdMethod · 0.95

Calls 2

aggregateMethod · 0.95

Tested by

no test coverage detected