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

Method count

python/ray/data/grouped_data.py:377–391  ·  view source on GitHub ↗

Compute count aggregation. Examples: >>> import ray >>> ray.data.from_items([ # doctest: +SKIP ... {"A": x % 3, "B": x} for x in range(100)]).groupby( # doctest: +SKIP ... "A").count() # doctest: +SKIP Returns: A d

(self)

Source from the content-addressed store, hash-verified

375
376 @PublicAPI(api_group=CDS_API_GROUP)
377 def count(self) -> Dataset:
378 """Compute count aggregation.
379
380 Examples:
381 >>> import ray
382 >>> ray.data.from_items([ # doctest: +SKIP
383 ... {"A": x % 3, "B": x} for x in range(100)]).groupby( # doctest: +SKIP
384 ... "A").count() # doctest: +SKIP
385
386 Returns:
387 A dataset of ``[k, v]`` columns where ``k`` is the groupby key and
388 ``v`` is the number of rows with that key.
389 If groupby key is ``None`` then the key part of return is omitted.
390 """
391 return self.aggregate(Count())
392
393 @PublicAPI(api_group=CDS_API_GROUP)
394 def sum(

Callers

nothing calls this directly

Calls 2

aggregateMethod · 0.95
CountClass · 0.90

Tested by

no test coverage detected