MCPcopy Create free account
hub / github.com/holoviz/hvplot / rands_array

Function rands_array

hvplot/tests/util.py:19–30  ·  view source on GitHub ↗

Generate an array of byte strings.

(nchars, size, dtype='O', replace=True)

Source from the content-addressed store, hash-verified

17
18
19def rands_array(nchars, size, dtype='O', replace=True):
20 """
21 Generate an array of byte strings.
22 """
23 chars = np.array(list(string.ascii_letters + string.digits), dtype=(np.str_, 1))
24 retval = (
25 np.random.default_rng(2)
26 .choice(chars, size=nchars * np.prod(size), replace=replace)
27 .view((np.str_, nchars))
28 .reshape(size)
29 )
30 return retval.astype(dtype)
31
32
33def makeStringIndex(k=10, name=None):

Callers 1

makeStringIndexFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…