count_
agg.count_ returns an aggregator that computes the number of elements within an aggregation group.
Note
count is a reserved Python keyword, so an underscore is used to maintain Python conventions.
Syntax
Parameters
| Parameter | Type | Description |
|---|---|---|
| col | str | The name of the output column that will contain the number of elements in each group. |
Returns
An aggregator that computes the number of elements within an aggregation group, for each group.
Examples
In this example, agg.count adds a count column, Number, while agg.avgreturns the average Number, as grouped by X.