MCPcopy Create free account
hub / github.com/dask/dask / choice

Method choice

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

Source from the content-addressed store, hash-verified

536
537 @derived_from(np.random.RandomState, skipblocks=1)
538 def choice(self, a, size=None, replace=True, p=None, chunks="auto"):
539 # TODO(expr): Fix this, this is ugly and should happen later
540 (
541 a,
542 size,
543 replace,
544 p,
545 axis, # np.random.RandomState.choice does not use axis
546 chunks,
547 meta,
548 dependencies,
549 ) = _choice_validate_params(self, a, size, replace, p, 0, chunks)
550
551 return new_collection(
552 RandomChoice(a.expr, chunks, meta, self._numpy_state, replace, p)
553 )
554
555 @derived_from(np.random.RandomState, skipblocks=1)
556 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