ray.data.grouped_data.GroupedData.count#

GroupedData.count() Dataset[source]#

Compute count aggregation.

Examples

>>> import ray
>>> ray.data.from_items([ 
...     {"A": x % 3, "B": x} for x in range(100)]).groupby( 
...     "A").count() 
Returns:

A dataset of [k, v] columns where k is the groupby key and v is the number of rows with that key. If groupby key is None then the key part of return is omitted.