MCPcopy
hub / github.com/pydata/xarray / randint

Function randint

asv_bench/benchmarks/__init__.py:49–56  ·  view source on GitHub ↗
(low, high=None, size=None, frac_minus=None, seed=0)

Source from the content-addressed store, hash-verified

47
48
49def randint(low, high=None, size=None, frac_minus=None, seed=0):
50 rng = np.random.default_rng(seed)
51 x = rng.integers(low, high, size)
52 if frac_minus is not None:
53 inds = rng.choice(range(x.size), int(x.size * frac_minus))
54 x.flat[inds] = -1
55
56 return x
57
58
59def _skip_slow():

Callers 4

make_dsMethod · 0.85
make_datatreeMethod · 0.85
indexing.pyFile · 0.85
make_vectorized_indexesFunction · 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…