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

Method choice

dask/array/_array_expr/random.py:536–551  ·  view source on GitHub ↗
(self, a, size=None, replace=True, p=None, chunks="auto")

Source from the content-addressed store, hash-verified

534
535 @derived_from(np.random.RandomState, skipblocks=1)
536 def choice(self, a, size=None, replace=True, p=None, chunks="auto"):
537 # TODO(expr): Fix this, this is ugly and should happen later
538 (
539 a,
540 size,
541 replace,
542 p,
543 axis, # np.random.RandomState.choice does not use axis
544 chunks,
545 meta,
546 dependencies,
547 ) = _choice_validate_params(self, a, size, replace, p, 0, chunks)
548
549 return new_collection(
550 RandomChoice(a.expr, chunks, meta, self._numpy_state, replace, p)
551 )
552
553 @derived_from(np.random.RandomState, skipblocks=1)
554 def exponential(self, scale=1.0, size=None, chunks="auto", **kwargs):

Callers 1

_choice_rsFunction · 0.95

Calls 3

new_collectionFunction · 0.90
RandomChoiceClass · 0.85
_choice_validate_paramsFunction · 0.70

Tested by

no test coverage detected