MCPcopy
hub / github.com/dask/dask / count

Method count

dask/bag/core.py:1113–1123  ·  view source on GitHub ↗

Count the number of elements. Examples -------- >>> import dask.bag as db >>> numbers = db.from_sequence([1, 2, 3]) >>> numbers.count().compute() 3

(self, split_every=None)

Source from the content-addressed store, hash-verified

1111 return self.reduction(all, all, split_every=split_every)
1112
1113 def count(self, split_every=None):
1114 """Count the number of elements.
1115
1116 Examples
1117 --------
1118 >>> import dask.bag as db
1119 >>> numbers = db.from_sequence([1, 2, 3])
1120 >>> numbers.count().compute()
1121 3
1122 """
1123 return self.reduction(count, sum, split_every=split_every)
1124
1125 def mean(self):
1126 """Arithmetic mean"""

Callers 15

rewrite_blockwiseFunction · 0.45
_task_spec.pyFile · 0.45
concatFunction · 0.45
test_read_textFunction · 0.45
test_files_per_partitionFunction · 0.45
test_complex_delimiterFunction · 0.45
test_distinctFunction · 0.45
test_reductionsFunction · 0.45
test_aggregationFunction · 0.45
test_empty_bagFunction · 0.45

Calls 1

reductionMethod · 0.95

Tested by 15

test_read_textFunction · 0.36
test_files_per_partitionFunction · 0.36
test_complex_delimiterFunction · 0.36
test_distinctFunction · 0.36
test_reductionsFunction · 0.36
test_aggregationFunction · 0.36
test_empty_bagFunction · 0.36
test_full_datasetFunction · 0.36
test_method_callerFunction · 0.36
test_methodsFunction · 0.36