MCPcopy Index your code
hub / github.com/python/cpython / count_positive

Function count_positive

Lib/statistics.py:242–250  ·  view source on GitHub ↗
(iterable)

Source from the content-addressed store, hash-verified

240 found_zero = False
241
242 def count_positive(iterable):
243 nonlocal n, found_zero
244 for n, x in enumerate(iterable, start=1):
245 if x > 0.0 or math.isnan(x):
246 yield x
247 elif x == 0.0:
248 found_zero = True
249 else:
250 raise StatisticsError('No negative inputs allowed', x)
251
252 total = fsum(map(log, count_positive(data)))
253

Callers 1

geometric_meanFunction · 0.85

Calls 2

enumerateFunction · 0.85
StatisticsErrorClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…