MCPcopy Index your code
hub / github.com/dask/dask / compute_first_bit

Function compute_first_bit

dask/dataframe/hyperloglog.py:20–25  ·  view source on GitHub ↗

Compute the position of the first nonzero bit for each int in an array.

(a)

Source from the content-addressed store, hash-verified

18
19
20def compute_first_bit(a):
21 "Compute the position of the first nonzero bit for each int in an array."
22 # TODO: consider making this less memory-hungry
23 bits = np.bitwise_and.outer(a, 1 << np.arange(32))
24 bits = bits.cumsum(axis=1).astype(bool)
25 return 33 - bits.sum(axis=1)
26
27
28def compute_hll_array(obj, b):

Callers 1

compute_hll_arrayFunction · 0.85

Calls 5

outerMethod · 0.45
arangeMethod · 0.45
astypeMethod · 0.45
cumsumMethod · 0.45
sumMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…