ray.data.grouped_dataset.GroupedDataset.count
ray.data.grouped_dataset.GroupedDataset.count#
- GroupedDataset.count() ray.data.dataset.Dataset[ray.data.block.U] [source]#
Compute count aggregation.
Examples
>>> import ray >>> ray.data.range(100).groupby(lambda x: x % 3).count() >>> ray.data.from_items([ ... {"A": x % 3, "B": x} for x in range(100)]).groupby( ... "A").count()
- Returns
A simple dataset of
(k, v)
pairs or an Arrow dataset of[k, v]
columns wherek
is the groupby key andv
is the number of rows with that key. If groupby key isNone
then the key part of return is omitted.